<?php

namespace App\Console\Commands\Pair;

use App\Models\Fpdx\ActivityModel;
use Illuminate\Console\Command;

class CreateActivityCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'pair:activity';

    /**
     * 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()
    {
        ActivityModel::create([
            'activity_name' => '一周CP',
            'signbegin_time' => mktime(12, 0, 0),
            'signend_time' => mktime(12, 0, 0) + 7 * 24 * 3600,
            'activity_time' => mktime(12, 0, 0) + 7 * 24 * 3600 + 12 * 3600,
            'open_time' => mktime(12, 0, 0) + 7 * 24 * 3600 + 6 * 3600,
            'close_time' => mktime(12, 0, 0) + 10 * 24 * 3600 + 12 * 3600,
            'rematch_begin_at' => mktime(12, 0, 0) + (7 * 24 + 12 + 10) * 3600,
            'rematched_at' => mktime(12, 0, 0) + 8 * 24 * 3600
        ]);
        $vs = new \App\Services\User\VipService();
        $vs->send72hourTicket();
    }
}
