<?php
/**
 * 优化师新增用户统计
 * @file:PromotionDayUserStatistic.php
 * @Date: 2023/6/25
 * @Time: 16:38
 */


namespace App\Console\Commands\Statistic;

use Illuminate\Console\Command;
use Modules\Common\Services\Statistic\OptimizerDayUser;

class OptimizerDayUserStatistic extends Command
{

    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'Statistic:OptimizerDayUser {--date= : 统计日期}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '优化师当日新增用户日统计';

    /**
     * Execute the console command.
     */
    public function handle(): void
    {

        $date = $this->option('date') ?? date('Y-m-d', strtotime('yesterday'));
        $this->info('统计开始--统计日期:'.$date);
        OptimizerDayUser::optimizerDayUserStatistic($date);
        $this->info('统计结束');
    }
}