setName('ExpireVerifyChecker') ->setDescription('Expire Verify Checker'); } protected function execute(Input $input, Output $output) { $where = []; $where[] = ["active", "=", 1]; $where[] = ["type", "=", \app\common\state\ProjectState::TALENT]; $whereRaw = sprintf("submitEndTime is not null and submitEndTime<>'' and submitEndTime < '%s'", date("Y-m-d H:i:s")); $batchs = \app\common\model\Batch::where($where)->whereRaw($whereRaw)->select(); if ($batchs) { unset($where); //存在激活的批次,并且有设置提交截止时间,且已经超过截止时间,则检查此批次的申报是否存在驳回或者尚在保存未提交状态 foreach ($batchs as $batch) { $where[] = ["e.type", "=", $batch["source"]]; $where[] = ["ti.checkState", "=", TalentState::SCND_SAVE]; $where[] = ["apply_year", "in", $batch["batch"]]; $list = Talent::alias("ti") ->leftJoin("un_enterprise e", "e.id=ti.enterprise_id") ->field("ti.*,e.type as enterpriseType") ->where($where)->select(); foreach ($list as $ti) { queue("app\job\Talent", ["type" => 2, "talentInfo" => $ti]); } } } } }