|
@@ -408,10 +408,21 @@ class VerifyApi {
|
|
|
if ($process == 5) {
|
|
|
$whereRaw = sprintf("(tl.state in (14,15,16)) or (tl.state=12 and ti.pass_dept_check=0) or (tl.state=10 and ti.pass_dept_check=1) or (tl.state=10 and (tc.companyIds is null or tc.companyIds = ''))");
|
|
|
switch ($params["checkState"]) {
|
|
|
- case 1:
|
|
|
+ case 1://待复审(首次提交)
|
|
|
+ $where[] = ["tl.state", "in", [TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
|
|
|
+ $where[] = ["tl2.resubmit", "EXP", Db::raw("is null")];
|
|
|
+ break;
|
|
|
+ case 2://待复审(重新提交)
|
|
|
$where[] = ["tl.state", "in", [TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
|
|
|
+ $where[] = ["tl2.resubmit", "EXP", Db::raw("is not null")];
|
|
|
+ break;
|
|
|
+ case 3://复审通过
|
|
|
+ $where[] = ["tl.state", "=", TalentState::REVERIFY_PASS];
|
|
|
+ break;
|
|
|
+ case 4://复审驳回
|
|
|
+ $where[] = ["tl.state", "=", TalentState::REVERIFY_REJECT];
|
|
|
break;
|
|
|
- case -1:
|
|
|
+ case 5://复审不通过
|
|
|
$where[] = ["tl.state", "=", TalentState::REVERIFY_FAIL];
|
|
|
break;
|
|
|
}
|
|
@@ -419,18 +430,18 @@ class VerifyApi {
|
|
|
->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
|
|
|
->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
|
|
|
->leftJoin("(select mainId,last_state,new_state,state,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")
|
|
|
- //->leftJoin("new_talent_checklog tl", "tl.mainId=ti.id and tl.id=(select id from new_talent_checklog where mainId=ti.id and `step` is null and active=1 and typeFileId is null order by createTime desc limit 1)")
|
|
|
+ ->leftJoin("(select id as resubmit,mainId from new_talent_checklog where state=15 and `type`=1 and `active`=1 group by mainId) as tl2", "`tl2`.mainId=`ti`.id")
|
|
|
->whereRaw($whereRaw)->where($where)->count();
|
|
|
$list = Talent::alias("ti")
|
|
|
->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
|
|
|
->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
|
|
|
->leftJoin("(select mainId,last_state,new_state,state,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")
|
|
|
- //->leftJoin("new_talent_checklog tl", "tl.mainId=ti.id and tl.id=(select id from new_talent_checklog where mainId=ti.id and `step` is null and active=1 and typeFileId is null order by createTime desc limit 1)")
|
|
|
+ ->leftJoin("(select id as resubmit,mainId from new_talent_checklog where state=15 and `type`=1 and `active`=1 group by mainId) as tl2", "`tl2`.mainId=`ti`.id")
|
|
|
->whereRaw($whereRaw)
|
|
|
->where($where)
|
|
|
->limit($offset, $limit)
|
|
|
->order("ti.createTime " . $order)
|
|
|
- ->field("ti.*,tl.last_state as 'lastState',tl.state as 'realState',e.name as enterprise_name,e.type as enterprise_type,enterpriseTag")
|
|
|
+ ->field("ti.*,tl.last_state as 'lastState',tl.state as 'realState',e.name as enterprise_name,e.type as enterprise_type,enterpriseTag,tl2.resubmit")
|
|
|
->select()->toArray();
|
|
|
} else {
|
|
|
switch ($process) {
|
|
@@ -487,6 +498,7 @@ class VerifyApi {
|
|
|
break;
|
|
|
case 6:
|
|
|
$where[] = ["tl.state", ">=", TalentState::REVERIFY_PASS];
|
|
|
+ $where[] = ["tl.state", "not in", [TalentState::REVERIFY_REJECT, TalentState::REVERIFY_FAIL]];
|
|
|
if ($params["checkState"]) {
|
|
|
$where[] = ["tl.state", "=", $params["checkState"]];
|
|
|
}
|
|
@@ -758,10 +770,21 @@ class VerifyApi {
|
|
|
case 5:
|
|
|
$whereRaw = sprintf("(tl.state in (14,15,16)) or (tl.state=12 and ti.pass_dept_check=0) or (tl.state=10 and ti.pass_dept_check=1) or (tl.state=10 and (tc.companyIds is null or tc.companyIds = ''))");
|
|
|
switch ($params["checkState"]) {
|
|
|
- case 1:
|
|
|
+ case 1://待复审(首次提交)
|
|
|
$where[] = ["tl.state", "in", [TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
|
|
|
+ $where[] = ["tl2.resubmit", "EXP", Db::raw("is null")];
|
|
|
+ break;
|
|
|
+ case 2://待复审(重新提交)
|
|
|
+ $where[] = ["tl.state", "in", [TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
|
|
|
+ $where[] = ["tl2.resubmit", "EXP", Db::raw("is not null")];
|
|
|
+ break;
|
|
|
+ case 3://复审通过
|
|
|
+ $where[] = ["tl.state", "=", TalentState::REVERIFY_PASS];
|
|
|
break;
|
|
|
- case -1:
|
|
|
+ case 4://复审驳回
|
|
|
+ $where[] = ["tl.state", "=", TalentState::REVERIFY_REJECT];
|
|
|
+ break;
|
|
|
+ case 5://复审不通过
|
|
|
$where[] = ["tl.state", "=", TalentState::REVERIFY_FAIL];
|
|
|
break;
|
|
|
}
|
|
@@ -810,11 +833,12 @@ class VerifyApi {
|
|
|
->select()->toArray();
|
|
|
}
|
|
|
} else if ($process == 5) {
|
|
|
+ $fields[] = "tl2.resubmit";
|
|
|
$list = Talent::alias("ti")
|
|
|
->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
|
|
|
->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
|
|
|
->leftJoin("(select description,mainId,last_state,new_state,state,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")
|
|
|
- //->leftJoin("new_talent_checklog tl", "tl.mainId=ti.id and tl.id=(select id from new_talent_checklog where mainId=ti.id and `step` is null and active=1 and typeFileId is null order by createTime desc limit 1)")
|
|
|
+ ->leftJoin("(select id as resubmit,mainId from new_talent_checklog where state=15 and `type`=1 and `active`=1 group by mainId) as tl2", "`tl2`.mainId=`ti`.id")
|
|
|
->whereRaw($whereRaw)
|
|
|
->where($where)
|
|
|
->field($fields)
|
|
@@ -890,7 +914,11 @@ class VerifyApi {
|
|
|
if ($process == 3) {
|
|
|
$item["checkState"] = "初审通过(待复审)";
|
|
|
} else {
|
|
|
- $item["checkState"] = "待复审";
|
|
|
+ if ($item["resubmit"]) {
|
|
|
+ $item["checkState"] = "待复审(重新提交)";
|
|
|
+ } else {
|
|
|
+ $item["checkState"] = "待复审(首次提交)";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if ($item["pass_dept_check"] == 0) {
|
|
@@ -913,10 +941,18 @@ class VerifyApi {
|
|
|
} else if ($process == 4) {
|
|
|
$item["checkState"] = "部门并审通过";
|
|
|
} else {
|
|
|
- $item["checkState"] = "待复审";
|
|
|
+ if ($item["resubmit"]) {
|
|
|
+ $item["checkState"] = "待复审(重新提交)";
|
|
|
+ } else {
|
|
|
+ $item["checkState"] = "待复审(首次提交)";
|
|
|
+ }
|
|
|
}
|
|
|
} else if ($item["state"] == TalentState::REVERIFY_REJECT) {
|
|
|
- $item["checkState"] = "待初审(复审驳回)";
|
|
|
+ if ($process == 3) {
|
|
|
+ $item["checkState"] = "待初审(复审驳回)";
|
|
|
+ } else {
|
|
|
+ $item["checkState"] = "复审驳回";
|
|
|
+ }
|
|
|
} else {
|
|
|
$item["checkState"] = TalentState::getStateName($item["state"]);
|
|
|
}
|