UpgradeDaily.php 1.7 KB

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