<?php

namespace App\Console\Commands\Trade;

use App\Modules\Order\Services\OrderService;
use Illuminate\Console\Command;

class RecalcOrderStatistic extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'recalc_order_statistic {date}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '重算充值统计';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $date = $this->argument('date');
        (new OrderService)->reCalcOrderStatisticAmount($date);
    }
}
