Kernel.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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\AutoBanUserJob::class,
  14. \App\Console\Commands\AutoDecGoodsTrafficJob::class,
  15. \App\Console\Commands\AutoDisableExpireUserJob::class,
  16. \App\Console\Commands\AutoExpireCouponJob::class,
  17. \App\Console\Commands\AutoExpireInviteJob::class,
  18. //\App\Console\Commands\AutoGetLocationInfoJob::class,
  19. \App\Console\Commands\AutoReopenUserJob::class,
  20. \App\Console\Commands\AutoResetUserTrafficJob::class,
  21. \App\Console\Commands\AutoStatisticsNodeDailyTrafficJob::class,
  22. \App\Console\Commands\AutoStatisticsNodeHourlyTrafficJob::class,
  23. \App\Console\Commands\AutoStatisticsUserDailyTrafficJob::class,
  24. \App\Console\Commands\AutoStatisticsUserHourlyTrafficJob::class,
  25. \App\Console\Commands\UserExpireWarningJob::class,
  26. \App\Console\Commands\UserTrafficWarningJob::class,
  27. ];
  28. /**
  29. * Define the application's command schedule.
  30. *
  31. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  32. * @return void
  33. */
  34. protected function schedule(Schedule $schedule)
  35. {
  36. $schedule->command('command:autoBanUserJob')->everyThirtyMinutes();
  37. $schedule->command('command:autoDecGoodsTrafficJob')->everyTenMinutes();
  38. $schedule->command('command:autoDisableExpireUserJob')->everyMinute();
  39. $schedule->command('command:autoExpireCouponJob')->everyThirtyMinutes();
  40. $schedule->command('command:autoExpireInviteJob')->everyThirtyMinutes();
  41. //$schedule->command('command:autoGetLocationInfoJob')->everyMinute();
  42. $schedule->command('command:autoReopenUserJob')->everyMinute();
  43. $schedule->command('command:autoResetUserTrafficJob')->monthly();
  44. $schedule->command('command:autoStatisticsNodeDailyTrafficJob')->dailyAt('04:30');
  45. $schedule->command('command:autoStatisticsNodeHourlyTrafficJob')->hourly();
  46. $schedule->command('command:autoStatisticsUserDailyTrafficJob')->dailyAt('03:00');
  47. $schedule->command('command:autoStatisticsUserHourlyTrafficJob')->hourly();
  48. $schedule->command('command:userExpireWarningJob')->daily();
  49. $schedule->command('command:userTrafficWarningJob')->daily();
  50. }
  51. /**
  52. * Register the Closure based commands for the application.
  53. *
  54. * @return void
  55. */
  56. protected function commands()
  57. {
  58. require base_path('routes/console.php');
  59. }
  60. }