<?php
/**
维护签到交互表
 */

namespace App\Console\Commands\Tool;

use App\Modules\User\Models\TempsUserSign;
use App\Modules\User\Models\SmartPushUserSign;
use Log;
use Illuminate\Console\Command;
use DB;

class MaintainUserSign extends Command
{
    /**
     * 执行命令  MaintainUserSign
     *
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'MaintainUserSign';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '维护签到交互表';

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        ini_set('memory_limit', '1024M');
        print_r('memory_used:'.memory_get_usage()."\n");
        print_r("======维护签到交互表【任务执行开始】=====".date("y-m-d H:i:s"."\n"));
      
        $smart_push_end_time = date('Y-m-d 00:00:00',strtotime('- 3 day'));
        $temp_end_time = date('Y-m-d 00:00:00',strtotime('- 60 day'));
        \Log::info('MaintainUserSign_start:smart_push_end_time:'.$smart_push_end_time.' temp_end_time:'.$temp_end_time);
        SmartPushUserSign::deleteSmartPushUserSignByTime($smart_push_end_time);
        //TempsUserSign::deleteTempsUserSignByTime($temp_end_time);
        \Log::info('MaintainUserSign_end');
        
        print_r("======维护签到交互表 【任务执行结束】=====".date("y-m-d H:i:s"."\n"));
        print_r('memory_used:'.memory_get_usage()."\n");
    }
}