Kernel.php 1.1 KB

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