UpgradeDaily.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. if(app()->isLocal()==false){
  38. $this->call('message:webhook',[
  39. 'listener' => 'dingtalk',
  40. 'url' => 'dingtalk1',
  41. 'title' => "后台任务",
  42. 'message' => " wikipali: 每日统计后台任务开始执行。",
  43. ]);
  44. }
  45. # 刷巴利语句子uuid 仅调用一次
  46. $this->call('upgrade:palitextid');
  47. //巴利原文段落库目录结构改变时运行
  48. $this->call('upgrade:palitext');
  49. #巴利段落标签
  50. $this->call('upgrade:palitexttag');
  51. #译文进度
  52. $this->call('upgrade:progress');
  53. $this->call('upgrade:progresschapter');
  54. # 段落更新图
  55. $this->call('upgrade:chapterdynamic');
  56. # 逐词译数据库分析
  57. $this->call('upgrade:wbwanalyses');
  58. $time = time()-$start;
  59. if(app()->isLocal()==false){
  60. $this->call('message:webhook',[
  61. 'listener' => 'dingtalk',
  62. 'url' => 'dingtalk1',
  63. 'title' => "后台任务",
  64. 'message' => "wikipali: 每日统计后台任务执行完毕。用时{$time}",
  65. ]);
  66. }
  67. return 0;
  68. }
  69. }