request->param("step");
if ($step) {
$cache_kvs = [
["func" => "\app\common\model\Company::cache", "stepName" => "部门"],
["func" => "\app\common\model\IntegralProject::cache", "stepName" => "积分项目"],
["func" => "\app\common\model\IntegralItem::cache", "stepName" => "积分标准"]
];
$cache = $cache_kvs[$step - 1];
if ($cache) {
$time1 = microtime(true);
$cache["func"]();
$time2 = microtime(true);
$runtime = round($time2 - $time1, 2);
$step++;
echo '';
echo '';
} else {
echo '';
}
} else {
return view();
}
}
/**
* 恢复自动审核失败
*/
public function recovery() {
$batch = 2022; //得更改批次
$type = 1; //人才类型 1:晋江人才 2:电路人才
$where = [];
$where[] = ["ti.apply_year", "=", $batch];
$where[] = ["ti.checkState", "=", \app\common\api\TalentState::FST_VERIFY_FAIL];
$where[] = ["e.type", "=", $type];
$where[] = ["tl.createUser", "=", "系统"];
$where[] = ["tl.state", "=", \app\common\api\TalentState::FST_VERIFY_FAIL];
$list = \app\enterprise\model\Talent::alias("ti")
->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
->leftJoin("(select mainId,last_state,new_state,state,createUser,createTime from new_talent_checklog where md5(concat(createTime,mainId,`type`)) in (select md5(concat(max(createTime),mainId,`type`)) from `new_talent_checklog` where `type`=1 and `step` is null and active=1 and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ti.id")
->where($where)
->field("ti.*,e.type as enterpriseType")
->select()->toArray();
if ($list) {
foreach ($list as $ti) {
queue("app\job\Talent", ["type" => 3, "talentInfo" => $ti]);
}
}
}
}