UpgradeDaily.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. namespace App\Console\Commands;
  3. use Illuminate\Console\Command;
  4. use Illuminate\Support\Carbon;
  5. use Illuminate\Support\Facades\Http;
  6. class UpgradeDaily extends Command
  7. {
  8. /**
  9. * The name and signature of the console command.
  10. *
  11. * @var string
  12. */
  13. protected $signature = 'upgrade:daily';
  14. /**
  15. * The console command description.
  16. *
  17. * @var string
  18. */
  19. protected $description = '每天的任务';
  20. /**
  21. * Create a new command instance.
  22. *
  23. * @return void
  24. */
  25. public function __construct()
  26. {
  27. parent::__construct();
  28. }
  29. /**
  30. * Execute the console command.
  31. *
  32. * @return int
  33. */
  34. public function handle()
  35. {
  36. $start = time();
  37. $this->call('message:webhook',[
  38. 'listener' => 'dingtalk',
  39. 'url' => 'dingtalk1',
  40. 'title' => "后台任务",
  41. 'message' => " wikipali: 每日统计后台任务开始执行。",
  42. ]);
  43. # 刷巴利语句子uuid 仅调用一次
  44. $this->call('upgrade:palitextid');
  45. //巴利原文段落库目录结构改变时运行
  46. $this->call('upgrade:palitext');
  47. #巴利段落标签
  48. $this->call('upgrade:palitexttag');
  49. #译文进度
  50. $this->call('upgrade:progress');
  51. $this->call('upgrade:progresschapter');
  52. # 段落更新图
  53. $this->call('upgrade:chapterdynamic');
  54. # 逐词译数据库分析
  55. $this->call('upgrade:wbwanalyses');
  56. $time = time()-$start;
  57. $this->call('message:webhook',[
  58. 'listener' => 'dingtalk',
  59. 'url' => 'dingtalk1',
  60. 'title' => "后台任务",
  61. 'message' => "wikipali: 每日统计后台任务执行完毕。用时{$time}",
  62. ]);;
  63. return 0;
  64. }
  65. }