<?php

namespace App\Console;


use App\Console\Commands\Push\PushStats;
use App\Console\Commands\Push\PushTag;
use App\Console\Commands\Push\PushTask;
use App\Console\Commands\Push\PushTest;
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 = [
        PushStats::class,
        PushTest::class,
        PushTask::class,
        PushTag::class,
        Commands\Activity\ActivityStats::class,
        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,
        Commands\Test::class,
    ];

    /**
     * Define the application's command schedule.
     *
     * @param \Illuminate\Console\Scheduling\Schedule $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        // 推送任务每分钟执行
        $schedule->command('push:task')->everyMinute()->sendOutputTo(storage_path('pushCommand-' . date('Y-m-d')));

        // 每天的活动统计
        $schedule->command('activity:stats')->dailyAt('01:00');

        // 每天的推送统计
        $schedule->command('push:stats')->dailyAt('00:30');
    }
}
