Kernel.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace App\Console;
  3. use Illuminate\Console\Scheduling\Schedule;
  4. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  5. class Kernel extends ConsoleKernel
  6. {
  7. /**
  8. * Define the application's command schedule.
  9. *
  10. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  11. * @return void
  12. */
  13. protected function schedule(Schedule $schedule)
  14. {
  15. // $schedule->command('inspire')->hourly();
  16. /**
  17. * 从掌维同步cp订阅统计数据
  18. */
  19. $schedule->command('ContentManage:SyncCpSubscribeStatisticDataFromZW')->dailyAt('13:00');
  20. /**
  21. * cp结算月统计
  22. */
  23. $schedule->command('ContentManage:CpSubscribeMonthStatisticData', [
  24. '--month' => date_sub(date_create(), date_interval_create_from_date_string('1 month'))->format('Y-m')
  25. ])->monthlyOn(1, '15:00');
  26. /**
  27. * 版权到期通知,每周一上午9点执行.
  28. */
  29. $schedule->command('ContentManage:BookCopyrightAlert')->weekly()->mondays()->at('09:00');
  30. /**
  31. * 新的cp方书籍进入内容中台, 通知
  32. */
  33. $schedule->command('ContentManage:NewCpBookComeIn')->dailyAt("08:30");
  34. /**
  35. * 保存书籍结算模式
  36. */
  37. $schedule->command('ContentManage:SaveBookSettlementMode')->daily();
  38. $schedule->command('ContentManage:cpcollection')->everyMinute();
  39. }
  40. /**
  41. * Register the commands for the application.
  42. *
  43. * @return void
  44. */
  45. protected function commands()
  46. {
  47. $this->load(__DIR__.'/Commands');
  48. require base_path('routes/console.php');
  49. }
  50. }