| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace App\Console;
- use App\Console\Commands\CommissionMoneyToBalance;
- use App\Console\Commands\Init\CreateSuperManager;
- use Illuminate\Console\Scheduling\Schedule;
- use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
- use Modules\ManageApi\Commands\PermissionResourceCommand;
- class Kernel extends ConsoleKernel
- {
- /**
- * The Artisan commands provided by your application.
- *
- * @var array
- */
- protected $commands = [
- // 开发环境创建超管.
- CreateSuperManager::class,
- // 更新后台权限资源表.
- PermissionResourceCommand::class,
- // 每日提成金额划给余额.
- CommissionMoneyToBalance::class,
- ];
- /**
- * Define the application's command schedule.
- *
- * @param \Illuminate\Console\Scheduling\Schedule $schedule
- * @return void
- */
- protected function schedule(Schedule $schedule)
- {
- // 每天凌晨00:05执行,一般凌晨延迟5分,部分服务器时区有点差异.
- $schedule->command('commission_money:balance')->dailyAt('00:05')->withoutOverlapping();
- $schedule->command('statistics:active')->dailyAt('00:02')->withoutOverlapping();
- $schedule->command('statistics:new_users')->dailyAt('00:03')->withoutOverlapping();
- $schedule->command('statistics:pay')->dailyAt('00:04')->withoutOverlapping();
- $schedule->command('statistics:users_attrs')->dailyAt('00:06')->withoutOverlapping();
- // 每1小时叠加当天的数据.
- $schedule->command('statistics:users_attrs_today')->hourly()->withoutOverlapping();
- // 每小时跟新usdt汇率
- $schedule->command('config:usdt_rate')->hourly()->withoutOverlapping();
- }
- /**
- * Register the commands for the application.
- *
- * @return void
- */
- protected function commands()
- {
- $this->load(__DIR__.'/Commands');
- require base_path('routes/console.php');
- }
- }
|