Kernel.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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\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. MiPushTest::class,
  18. HwPushTest::class,
  19. OppoPushTest::class,
  20. PushTest::class,
  21. Commands\BookAdjust::class,
  22. Commands\BookAdjustOne::class,
  23. Commands\BookSpider::class,
  24. Commands\BookUpdate::class,
  25. Commands\BookUpdateOne::class,
  26. Commands\BookTest::class,
  27. Commands\BookAfterSpider::class,
  28. Commands\BookAttr::class,
  29. Commands\YqBook::class,
  30. Commands\channelCpcCode::class,
  31. Commands\updateFromNewYunqi::class,
  32. Commands\CheckOrderStatus::class,
  33. Commands\NewVersionPrepare::class,
  34. ];
  35. /**
  36. * Define the application's command schedule.
  37. *
  38. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  39. * @return void
  40. */
  41. protected function schedule(Schedule $schedule)
  42. {
  43. $schedule->command('book:update')->hourly()->when(function () {
  44. $now_hour = date('G');
  45. if ($now_hour % 4 == 0) {
  46. return true;
  47. }
  48. return false;
  49. });
  50. }
  51. }