Kernel.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace App\Console;
  3. use Illuminate\Console\Scheduling\Schedule;
  4. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  5. class Kernel extends ConsoleKernel
  6. {
  7. /**
  8. * The Artisan commands provided by your application.
  9. *
  10. * @var array
  11. */
  12. protected $commands = [
  13. \App\Console\Commands\AutoDecGoodsTrafficJob::class,
  14. \App\Console\Commands\AutoDisableExpireUserJob::class,
  15. \App\Console\Commands\AutoExpireInviteJob::class,
  16. \App\Console\Commands\AutoExpireCouponJob::class,
  17. \App\Console\Commands\AutoResetUserTrafficJob::class,
  18. \App\Console\Commands\UserExpireWarningJob::class,
  19. \App\Console\Commands\UserTrafficWarningJob::class,
  20. ];
  21. /**
  22. * Define the application's command schedule.
  23. *
  24. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  25. * @return void
  26. */
  27. protected function schedule(Schedule $schedule)
  28. {
  29. $schedule->command('command:autoDecGoodsTrafficJob')->everyTenMinutes();
  30. $schedule->command('command:autoDisableExpireUserJob')->everyMinute();
  31. $schedule->command('command:autoExpireCouponJob')->everyThirtyMinutes();
  32. $schedule->command('command:autoExpireInviteJob')->everyThirtyMinutes();
  33. $schedule->command('command:autoResetUserTrafficJob')->monthly();
  34. $schedule->command('command:userExpireWarningJob')->daily();
  35. $schedule->command('command:userTrafficWarningJob')->daily();
  36. }
  37. /**
  38. * Register the Closure based commands for the application.
  39. *
  40. * @return void
  41. */
  42. protected function commands()
  43. {
  44. require base_path('routes/console.php');
  45. }
  46. }