|
@@ -245,7 +245,7 @@ class VerifyApi {
|
|
|
$where[] = ["tl.new_state", "=", TalentState::SCND_SUBMIT];
|
|
|
break;
|
|
|
default:
|
|
|
- $where = sprintf("(tl.active=0 and tl.state=%d) or (tl.active=1 and (tl.new_state in (%d,%d)))", TalentState::FST_VERIFY_PASS, TalentState::SCND_SUBMIT, TalentState::DEPT_VERIFY_PASS);
|
|
|
+ $whereRaw = sprintf("(tl.active=0 and tl.state=%d) or (tl.active=1 and (tl.new_state in (%d,%d)))", TalentState::FST_VERIFY_PASS, TalentState::SCND_SUBMIT, TalentState::DEPT_VERIFY_PASS);
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -257,6 +257,7 @@ class VerifyApi {
|
|
|
->leftJoin("(select mainId,active,last_state,new_state,state,createTime from new_talent_checklog where md5(concat(createTime,companyId,mainId,`type`)) in (select md5(concat(max(createTime),companyId,mainId,`type`)) from `new_talent_checklog` where `type`=1 and `step`=3 and companyId='{$companyId}' and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ti.id")
|
|
|
->leftJoin(sprintf("(select id as resubmit,mainId from new_talent_checklog where state in(%d,%d) and step is null and `type`=1 and `active`=1 group by mainId) as tl2", TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT), "`tl2`.mainId=`ti`.id")
|
|
|
->where($where)
|
|
|
+ ->whereRaw($whereRaw)
|
|
|
->whereRaw("find_in_set(:companyId,companyIds)", ["companyId" => $companyId])->count();
|
|
|
$list = Talent::alias("ti")
|
|
|
->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
|
|
@@ -264,6 +265,7 @@ class VerifyApi {
|
|
|
->leftJoin("(select mainId,active,last_state,new_state,state,createTime from new_talent_checklog where md5(concat(createTime,companyId,mainId,`type`)) in (select md5(concat(max(createTime),companyId,mainId,`type`)) from `new_talent_checklog` where `type`=1 and `step`=3 and companyId='{$companyId}' and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ti.id")
|
|
|
->leftJoin(sprintf("(select id as resubmit,mainId from new_talent_checklog where state in(%d,%d) and step is null and `type`=1 and `active`=1 group by mainId) as tl2", TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT), "`tl2`.mainId=`ti`.id")
|
|
|
->where($where)
|
|
|
+ ->whereRaw($whereRaw)
|
|
|
->whereRaw("find_in_set(:companyId,companyIds)", ["companyId" => $companyId])
|
|
|
->field("ti.*,tl.last_state as 'lastState',tl.state as 'realState',tl.new_state as 'newState',e.name as enterprise_name,e.type as enterprise_type,enterpriseTag,tc.name as talentConditionName,tl2.resubmit,tl.active as deptActive")
|
|
|
->limit($offset, $limit)->order("ti.createTime " . $order)
|
|
@@ -784,7 +786,7 @@ class VerifyApi {
|
|
|
$where[] = ["tl.new_state", "=", TalentState::SCND_SUBMIT];
|
|
|
break;
|
|
|
default:
|
|
|
- $where = sprintf("(tl.active=0 and tl.state=%d) or (tl.active=1 and (tl.new_state in (%d,%d)))", TalentState::FST_VERIFY_PASS, TalentState::SCND_SUBMIT, TalentState::DEPT_VERIFY_PASS);
|
|
|
+ $whereRaw = sprintf("(tl.active=0 and tl.state=%d) or (tl.active=1 and (tl.new_state in (%d,%d)))", TalentState::FST_VERIFY_PASS, TalentState::SCND_SUBMIT, TalentState::DEPT_VERIFY_PASS);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -833,8 +835,8 @@ class VerifyApi {
|
|
|
$fields[] = "tc.companyIds";
|
|
|
if ($process == 4) {
|
|
|
$fields[] = "tl2.resubmit";
|
|
|
- $fields[] = "tl3.deptVerifyJsonData";
|
|
|
if ($company_info["code"] == "super" || $company_info["code"] == "rsj") {
|
|
|
+ $fields[] = "tl3.deptVerifyJsonData";
|
|
|
$list = Talent::alias("ti")
|
|
|
->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
|
|
|
->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
|
|
@@ -855,6 +857,7 @@ class VerifyApi {
|
|
|
->leftJoin("(select mainId,active,description,last_state,new_state,state,createTime from new_talent_checklog where md5(concat(createTime,companyId,mainId,`type`)) in (select md5(concat(max(createTime),companyId,mainId,`type`)) from `new_talent_checklog` where `type`=1 and `step`=3 and companyId='{$companyId}' and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ti.id")
|
|
|
->leftJoin(sprintf("(select id as resubmit,mainId from new_talent_checklog where state in(%d,%d) and step is null and `type`=1 and `active`=1 group by mainId) as tl2", TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT), "`tl2`.mainId=`ti`.id")
|
|
|
->where($where)
|
|
|
+ ->whereRaw($whereRaw)
|
|
|
->whereRaw("find_in_set(:companyId,companyIds)", ["companyId" => $companyId])
|
|
|
->field($fields)
|
|
|
->select()->toArray();
|
|
@@ -991,44 +994,48 @@ class VerifyApi {
|
|
|
} else {
|
|
|
$item["checkState"] = TalentState::getStateName($item["state"]);
|
|
|
}
|
|
|
- if ($process == 4 && in_array($company_info["code"], ["super", "rsj"])) {
|
|
|
- $companys = array_filter(explode(",", $item["companyIds"]));
|
|
|
- $deptChecklogs = json_decode($item["deptVerifyJsonData"], true);
|
|
|
- $deptChecklogs = bubbleSort($deptChecklogs, "createTime", "desc");
|
|
|
- $verifyDepts = [];
|
|
|
- $item["deptReject"] = 0;
|
|
|
- $item["deptPass"] = 0;
|
|
|
- $item["deptWait"] = 0;
|
|
|
- $deptDescriptions = [];
|
|
|
- foreach ($companys as $k => $companyId) {
|
|
|
- $company = getCacheById("Company", $companyId);
|
|
|
- //$log = TalentLogApi::getCompanyNewestCheckedLog($item["id"], $companyId);
|
|
|
- $i = 0;
|
|
|
- while ($log = $deptChecklogs[$i]) {
|
|
|
- if ($log["companyId"] == $companyId) {
|
|
|
- break;
|
|
|
- }
|
|
|
- $i++;
|
|
|
- }
|
|
|
- $item["first_dept_check_time"] = $log["createTime"];
|
|
|
- $verifyDepts[$k] = $company["name"];
|
|
|
- if ($log["active"] == 1) {
|
|
|
- if ($log["new_state"] == 9) {
|
|
|
- $verifyDepts[$k] .= "(审核驳回)";
|
|
|
- $item["deptReject"]++;
|
|
|
+ if ($process == 4) {
|
|
|
+ if (in_array($company_info["code"], ["super", "rsj"])) {
|
|
|
+ $companys = array_filter(explode(",", $item["companyIds"]));
|
|
|
+ $deptChecklogs = json_decode($item["deptVerifyJsonData"], true);
|
|
|
+ $deptChecklogs = bubbleSort($deptChecklogs, "createTime", "desc");
|
|
|
+ $verifyDepts = [];
|
|
|
+ $item["deptReject"] = 0;
|
|
|
+ $item["deptPass"] = 0;
|
|
|
+ $item["deptWait"] = 0;
|
|
|
+ $deptDescriptions = [];
|
|
|
+ foreach ($companys as $k => $companyId) {
|
|
|
+ $company = getCacheById("Company", $companyId);
|
|
|
+ //$log = TalentLogApi::getCompanyNewestCheckedLog($item["id"], $companyId);
|
|
|
+ $i = 0;
|
|
|
+ while ($log = $deptChecklogs[$i]) {
|
|
|
+ if ($log["companyId"] == $companyId) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $i++;
|
|
|
}
|
|
|
- if ($log["new_state"] == 12) {
|
|
|
- $verifyDepts[$k] .= "(审核通过)";
|
|
|
- $item["deptPass"]++;
|
|
|
+ $item["first_dept_check_time"] = $log["createTime"];
|
|
|
+ $verifyDepts[$k] = $company["name"];
|
|
|
+ if ($log["active"] == 1) {
|
|
|
+ if ($log["new_state"] == 9) {
|
|
|
+ $verifyDepts[$k] .= "(审核驳回)";
|
|
|
+ $item["deptReject"]++;
|
|
|
+ }
|
|
|
+ if ($log["new_state"] == 12) {
|
|
|
+ $verifyDepts[$k] .= "(审核通过)";
|
|
|
+ $item["deptPass"]++;
|
|
|
+ }
|
|
|
+ $deptDescriptions[] = sprintf("%s:%s", $company["name"], $log["description"]);
|
|
|
+ } else {
|
|
|
+ $verifyDepts[$k] .= "(待审核)";
|
|
|
+ $item["deptWait"]++;
|
|
|
}
|
|
|
- $deptDescriptions[] = sprintf("%s:%s", $company["name"], $log["description"]);
|
|
|
- } else {
|
|
|
- $verifyDepts[$k] .= "(待审核)";
|
|
|
- $item["deptWait"]++;
|
|
|
}
|
|
|
+ $item["verifyDepts"] = implode(chr(10), $verifyDepts);
|
|
|
+ $item["deptDescription"] = implode(chr(10), $deptDescriptions);
|
|
|
+ } else {
|
|
|
+ $item["checkMsg"] = $item["active"] == 1 ? $item["checkMsg"] : "等待部门审核";
|
|
|
}
|
|
|
- $item["verifyDepts"] = implode(chr(10), $verifyDepts);
|
|
|
- $item["deptDescription"] = implode(chr(10), $deptDescriptions);
|
|
|
}
|
|
|
}unset($item);
|
|
|
return $list;
|