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]);
}
}
}
/**
* 导入旧的电路人才到新库
*
-1 复核不通过 173
1 待提交 4
7 待初审 22
10 初审驳回 44
20 复审驳回 1
25 初审通过 71
35 复核通过,待核查征信 1281
* isPublic 5:待发证 6:已发证
* active 1:在职 2:离职
* isEffect 1:有效 4:失效 其它:已过期
* 需要增加字段
* cur_quit_time离职时间
* active在职状态
* identifyMonth认证月份
* identifyExpireTime
* oldId 旧id
*/
public function import_old_jcdl() {
$where = [];
$where[] = ["type", "=", 2];
$where[] = ["name", "=", "杨忠宪"];
$list = Db::table("un_talent_info")->where($where)->select();
$count = session("oldJcjlTalentInfoToNewTable");
$count += count($list);
session("oldJcjlTalentInfoToNewTable", $count);
foreach ($list as $item) {
queue("app\job\Worker", ["type" => 99, "talent_info" => $item]);
}
echo "加入队列成功";
}
}