Kernel.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. $schedule->command('payOvertimeCheck')->everyMinute();
  33. }
  34. /**
  35. * Register the commands for the application.
  36. *
  37. * @return void
  38. */
  39. protected function commands()
  40. {
  41. $this->load(__DIR__.'/Commands');
  42. require base_path('routes/console.php');
  43. }
  44. }