<?php

namespace App\Console\Commands\Goodnight;

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

class CreateActivityCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'goodnight: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([
            'opened_at' => mktime(19, 0, 0),
            'closed_at' => mktime(19, 0, 0) + 24 * 60 * 60,
            'showed_at' => mktime(20, 0, 0) + 24 * 60 * 60,
            'end_at' => mktime(0, 0, 0) + 3 * 60 * 60
        ]);
    }
}
