Kernel.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace App\Console;
  3. use App\Console\Commands\IncrementSyncDrugReportCommand;
  4. use App\Console\Commands\IncrementSyncDrugReportAssCommand;
  5. use App\Console\Commands\HistorySyncDrugReportCommand;
  6. use App\Console\Commands\SignedSyncDrugReportCommand;
  7. use App\Console\Commands\UpdateDrugReportAssCommand;
  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. IncrementSyncDrugReportCommand::class,
  19. IncrementSyncDrugReportAssCommand::class,
  20. HistorySyncDrugReportCommand::class,
  21. SignedSyncDrugReportCommand::class,
  22. UpdateDrugReportAssCommand::class,
  23. ];
  24. /**
  25. * Define the application's command schedule.
  26. *
  27. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  28. * @return void
  29. */
  30. protected function schedule(Schedule $schedule)
  31. {
  32. $schedule->command('increment-drug-report')->everyThirtyMinutes();
  33. $schedule->command('increment-drug-report-ass')->everyThirtyMinutes();
  34. $schedule->command('update-drug-report-ass')->everyThreeHours(15);
  35. //$schedule->command('drug-report-history')->everyThirtyMinutes();
  36. //$schedule->command('drug-report-signed')->everyThirtyMinutes();
  37. }
  38. /**
  39. * Register the commands for the application.
  40. *
  41. * @return void
  42. */
  43. protected function commands()
  44. {
  45. // 自动引入任务命令
  46. $this->load(__DIR__.'/Commands');
  47. // 引入任务路由
  48. require base_path('routes/console.php');
  49. }
  50. }