Kernel.php 1.8 KB

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