1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace App\Console;
- use Illuminate\Console\Scheduling\Schedule;
- use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
- class Kernel extends ConsoleKernel
- {
- /**
- * The Artisan commands provided by your application.
- *
- * @var array
- */
- protected $commands = [
- Commands\BookAdjust::class,
- Commands\BookAdjustOne::class,
- Commands\BookSpider::class,
- Commands\BookUpdate::class,
- Commands\BookUpdateOne::class,
- Commands\BookTest::class,
- Commands\BookAfterSpider::class,
- Commands\BookAttr::class,
- Commands\YqBook::class,
- Commands\channelCpcCode::class,
- Commands\updateFromNewYunqi::class,
- Commands\CheckOrderStatus::class,
- Commands\NewVersionPrepare::class,
- ];
- /**
- * Define the application's command schedule.
- *
- * @param \Illuminate\Console\Scheduling\Schedule $schedule
- * @return void
- */
- protected function schedule(Schedule $schedule)
- {
- $schedule->command('book:update')->hourly()->when(function () {
- $now_hour = date('G');
- if ($now_hour % 4 == 0) {
- return true;
- }
- return false;
- });
- }
- }
|