123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace App\Console;
- use App\Console\Commands\Apollo;
- use App\Console\Commands\Downloads;
- use App\Console\Commands\PostStatistics;
- use App\Console\Commands\PostYesterday;
- use App\Console\Commands\VirusAdd;
- use Illuminate\Console\Scheduling\Schedule;
- use Laravel\Lumen\Console\Kernel as ConsoleKernel;
- class Kernel extends ConsoleKernel
- {
- /**
- * The Artisan commands provided by your application.
- *
- * @var array
- */
- protected $commands = [
- Apollo::class,
- PostYesterday::class,
- Downloads::class,
- VirusAdd::class,
- PostStatistics::class
- ];
- /**
- * Define the application's command schedule.
- *
- * @param \Illuminate\Console\Scheduling\Schedule $schedule
- * @return void
- */
- protected function schedule(Schedule $schedule)
- {
- $path = storage_path('logs/'.date('Y-m-d').'-schedule.log');
- $schedule->command('download:download')
- ->everyMinute()
- ->withoutOverlapping()->appendOutputTo($path);
- $schedule->command('post:yesterday')
- ->dailyAt('00:10')
- ->withoutOverlapping()->appendOutputTo($path);
- $schedule->command('post:statistics')
- ->dailyAt('00:20')
- ->withoutOverlapping()->appendOutputTo($path);
- //统计前一天用户行为累加
- $schedule->command('member:statistics')
- ->daily()
- ->withoutOverlapping()->appendOutputTo($path);
- }
- }
|