Kernel.php 1.7 KB

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