Kernel.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace App\Console;
  3. use App\Console\Commands\Push\PushStats;
  4. use App\Console\Commands\Push\PushTag;
  5. use App\Console\Commands\Push\PushTask;
  6. use App\Console\Commands\Push\PushTest;
  7. use Illuminate\Console\Scheduling\Schedule;
  8. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  9. class Kernel extends ConsoleKernel
  10. {
  11. /**
  12. * The Artisan commands provided by your application.
  13. *
  14. * @var array
  15. */
  16. protected $commands = [
  17. PushStats::class,
  18. PushTest::class,
  19. PushTask::class,
  20. PushTag::class,
  21. Commands\Activity\ActivityStats::class,
  22. Commands\BookAdjust::class,
  23. Commands\BookAdjustOne::class,
  24. Commands\BookSpider::class,
  25. Commands\BookUpdate::class,
  26. Commands\BookUpdateOne::class,
  27. Commands\BookTest::class,
  28. Commands\BookAfterSpider::class,
  29. Commands\BookAttr::class,
  30. Commands\YqBook::class,
  31. Commands\channelCpcCode::class,
  32. Commands\updateFromNewYunqi::class,
  33. Commands\CheckOrderStatus::class,
  34. Commands\NewVersionPrepare::class,
  35. Commands\Test::class,
  36. ];
  37. /**
  38. * Define the application's command schedule.
  39. *
  40. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  41. * @return void
  42. */
  43. protected function schedule(Schedule $schedule)
  44. {
  45. // 推送任务每分钟执行
  46. $schedule->command('push:task')->everyMinute()->sendOutputTo(storage_path('pushCommand-' . date('Y-m-d')));
  47. // 每天的活动统计
  48. $schedule->command('activity:stats')->dailyAt('01:00');
  49. // 每天的推送统计
  50. $schedule->command('push:stats')->dailyAt('00:30');
  51. }
  52. }