Kernel.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Console;
  3. use App\Console\Commands\ImportOrder;
  4. use App\Console\Commands\overTimeOrder;
  5. use App\Console\Commands\packExpiredCheck;
  6. use Illuminate\Console\Scheduling\Schedule;
  7. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  8. class Kernel extends ConsoleKernel
  9. {
  10. /**
  11. * The Artisan commands provided by your application.
  12. *
  13. * @var array
  14. */
  15. protected $commands = [
  16. //
  17. 'order'=>overTimeOrder::class,
  18. 'scheduleNotice'=>overTimeOrder::class,
  19. 'packExpiredCheck'=>packExpiredCheck::class,
  20. 'importOrder'=>ImportOrder::class,
  21. ];
  22. /**
  23. * Define the application's command schedule.
  24. *
  25. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  26. * @return void
  27. */
  28. protected function schedule(Schedule $schedule)
  29. {
  30. //检测服务包过期的定时任务
  31. $schedule->command('packExpiredCheck')->hourly();
  32. }
  33. /**
  34. * Register the commands for the application.
  35. *
  36. * @return void
  37. */
  38. protected function commands()
  39. {
  40. $this->load(__DIR__.'/Commands');
  41. require base_path('routes/console.php');
  42. }
  43. }