|
@@ -158,16 +158,22 @@ class VerifyApi {
|
|
|
$where[] = ["tc.companyIds", "like", "%" . $params["company_id"] . "%"];
|
|
|
}
|
|
|
switch ($params["checkState"]) {
|
|
|
- case 1:
|
|
|
+ case 1://待部门并审(首次提交)
|
|
|
$where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
|
$where[] = ["ti.pass_dept_check", "=", 0];
|
|
|
+ $where[] = ["tl2.resubmit", "EXP", Db::raw("is null")];
|
|
|
break;
|
|
|
- case 2:
|
|
|
- $where[] = ["tl.state", "=", TalentState::DEPT_VERIFY_REJECT];
|
|
|
+ case 2://待部门并审(重新提交)
|
|
|
+ $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
|
+ $where[] = ["ti.pass_dept_check", "=", 0];
|
|
|
+ $where[] = ["tl2.resubmit", "EXP", Db::raw("is not null")];
|
|
|
break;
|
|
|
- case 3:
|
|
|
+ case 3://部门并审通过
|
|
|
$where[] = ["tl.state", "=", TalentState::DEPT_VERIFY_PASS];
|
|
|
break;
|
|
|
+ case 4://部门并审驳回
|
|
|
+ $where[] = ["tl.state", "=", TalentState::DEPT_VERIFY_REJECT];
|
|
|
+ break;
|
|
|
default:
|
|
|
$whereRaw = sprintf("(tl.state=%d and ti.pass_dept_check=0) or (tl.state=%d) or (tl.state=%d)", TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS, TalentState::DEPT_VERIFY_REJECT);
|
|
|
break;
|
|
@@ -180,15 +186,17 @@ class VerifyApi {
|
|
|
->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
|
|
|
->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
|
|
|
->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(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)
|
|
|
->where($whereRaw)->count();
|
|
|
$list = Talent::alias("ti")
|
|
|
->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
|
|
|
->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
|
|
|
->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(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)
|
|
|
->where($whereRaw)
|
|
|
- ->field("ti.*,tl.last_state as 'lastState',tl.state as 'realState',e.name as enterprise_name,e.type as enterprise_type,enterpriseTag,tc.name as talentConditionName,tc.companyIds")
|
|
|
+ ->field("ti.*,tl.last_state as 'lastState',tl.state as 'realState',e.name as enterprise_name,e.type as enterprise_type,enterpriseTag,tc.name as talentConditionName,tc.companyIds,tl2.resubmit")
|
|
|
->limit($offset, $limit)->order("ti.createTime " . $order)
|
|
|
->select()->toArray();
|
|
|
foreach ($list as &$item) {
|
|
@@ -218,21 +226,24 @@ class VerifyApi {
|
|
|
$limit = $params["limit"] ?: 10;
|
|
|
$companyId = session("user")["companyId"];
|
|
|
switch ($params["checkState"]) {
|
|
|
- case 1:
|
|
|
- //待审核
|
|
|
+ case 1://待部门并审(首次提交)
|
|
|
$where[] = ["tl.active", "=", 0];
|
|
|
$where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
|
+ $where[] = ["tl2.resubmit", "EXP", Db::raw("is null")];
|
|
|
break;
|
|
|
- case 2:
|
|
|
- //已驳回
|
|
|
- $where[] = ["tl.active", "=", 1];
|
|
|
- $where[] = ["tl.new_state", "=", TalentState::SCND_SUBMIT];
|
|
|
+ case 2://待部门并审(重新提交)
|
|
|
+ $where[] = ["tl.active", "=", 0];
|
|
|
+ $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
|
+ $where[] = ["tl2.resubmit", "EXP", Db::raw("is not null")];
|
|
|
break;
|
|
|
- case 3:
|
|
|
- //已通过
|
|
|
+ case 3://部门并审通过
|
|
|
$where[] = ["tl.active", "=", 1];
|
|
|
$where[] = ["tl.new_state", "=", TalentState::DEPT_VERIFY_PASS];
|
|
|
break;
|
|
|
+ case 4://部门并审驳回
|
|
|
+ $where[] = ["tl.active", "=", 1];
|
|
|
+ $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);
|
|
|
break;
|
|
@@ -244,15 +255,17 @@ class VerifyApi {
|
|
|
->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
|
|
|
->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
|
|
|
->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("find_in_set(:companyId,companyIds)", ["companyId" => $companyId])->count();
|
|
|
$list = Talent::alias("ti")
|
|
|
->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
|
|
|
->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
|
|
|
->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("find_in_set(:companyId,companyIds)", ["companyId" => $companyId])
|
|
|
- ->field("ti.*,tl.last_state as 'lastState',tl.state as 'realState',e.name as enterprise_name,e.type as enterprise_type,enterpriseTag,tc.name as talentConditionName")
|
|
|
+ ->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)
|
|
|
->select()->toArray();
|
|
|
foreach ($list as &$item) {
|
|
@@ -430,13 +443,13 @@ 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("(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")
|
|
|
+ ->leftJoin("(select id as resubmit,mainId from new_talent_checklog where state=" . TalentState::REVERIFY_REJECT . " 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("(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")
|
|
|
+ ->leftJoin("(select id as resubmit,mainId from new_talent_checklog where state=" . TalentState::REVERIFY_REJECT . " and `type`=1 and `active`=1 group by mainId) as tl2", "`tl2`.mainId=`ti`.id")
|
|
|
->whereRaw($whereRaw)
|
|
|
->where($where)
|
|
|
->limit($offset, $limit)
|
|
@@ -733,34 +746,43 @@ class VerifyApi {
|
|
|
case 1:
|
|
|
$where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
|
$where[] = ["ti.pass_dept_check", "=", 0];
|
|
|
+ $where[] = ["tl2.resubmit", "EXP", Db::raw("is null")];
|
|
|
break;
|
|
|
case 2:
|
|
|
- $where[] = ["tl.state", "=", TalentState::DEPT_VERIFY_REJECT];
|
|
|
+ $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
|
+ $where[] = ["ti.pass_dept_check", "=", 0];
|
|
|
+ $where[] = ["tl2.resubmit", "EXP", Db::raw("is not null")];
|
|
|
break;
|
|
|
case 3:
|
|
|
$where[] = ["tl.state", "=", TalentState::DEPT_VERIFY_PASS];
|
|
|
break;
|
|
|
+ case 4:
|
|
|
+ $where[] = ["tl.state", "=", TalentState::DEPT_VERIFY_REJECT];
|
|
|
+ break;
|
|
|
default:
|
|
|
$whereRaw = sprintf("(tl.state=%d and ti.pass_dept_check=0) or (tl.state=%d) or (tl.state=%d)", TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS, TalentState::DEPT_VERIFY_REJECT);
|
|
|
break;
|
|
|
}
|
|
|
} else {
|
|
|
switch ($params["checkState"]) {
|
|
|
- case 1:
|
|
|
- //待审核
|
|
|
+ case 1://待部门并审(首次提交)
|
|
|
$where[] = ["tl.active", "=", 0];
|
|
|
$where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
|
+ $where[] = ["tl2.resubmit", "EXP", Db::raw("is null")];
|
|
|
break;
|
|
|
- case 2:
|
|
|
- //已驳回
|
|
|
- $where[] = ["tl.active", "=", 1];
|
|
|
- $where[] = ["tl.new_state", "=", TalentState::SCND_SUBMIT];
|
|
|
+ case 2://待部门并审(重新提交)
|
|
|
+ $where[] = ["tl.active", "=", 0];
|
|
|
+ $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
|
+ $where[] = ["tl2.resubmit", "EXP", Db::raw("is not null")];
|
|
|
break;
|
|
|
- case 3:
|
|
|
- //已通过
|
|
|
+ case 3://部门并审通过
|
|
|
$where[] = ["tl.active", "=", 1];
|
|
|
$where[] = ["tl.new_state", "=", TalentState::DEPT_VERIFY_PASS];
|
|
|
break;
|
|
|
+ case 4://部门并审驳回
|
|
|
+ $where[] = ["tl.active", "=", 1];
|
|
|
+ $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);
|
|
|
break;
|
|
@@ -810,11 +832,13 @@ class VerifyApi {
|
|
|
$fields[] = "tl.last_state";
|
|
|
$fields[] = "tc.companyIds";
|
|
|
if ($process == 4) {
|
|
|
+ $fields[] = "tl2.resubmit";
|
|
|
if ($company_info["code"] == "super" || $company_info["code"] == "rsj") {
|
|
|
$list = Talent::alias("ti")
|
|
|
->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
|
|
|
->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
|
|
|
->leftJoin("(select mainId,description,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(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)
|
|
|
->where($whereRaw)
|
|
|
->field($fields)
|
|
@@ -827,6 +851,7 @@ class VerifyApi {
|
|
|
->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
|
|
|
->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
|
|
|
->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("find_in_set(:companyId,companyIds)", ["companyId" => $companyId])
|
|
|
->field($fields)
|
|
@@ -838,7 +863,7 @@ class VerifyApi {
|
|
|
->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("(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")
|
|
|
+ ->leftJoin("(select id as resubmit,mainId from new_talent_checklog where state=" . TalentState::REVERIFY_REJECT . " and `type`=1 and `active`=1 group by mainId) as tl2", "`tl2`.mainId=`ti`.id")
|
|
|
->whereRaw($whereRaw)
|
|
|
->where($where)
|
|
|
->field($fields)
|
|
@@ -901,7 +926,11 @@ class VerifyApi {
|
|
|
} else if ($item["state"] == TalentState::FST_VERIFY_PASS) {
|
|
|
if ($item["deptCheckState"]) {
|
|
|
if ($item["acitve"] == 0 && $item["state"] == TalentState::FST_VERIFY_PASS) {
|
|
|
- $item["checkState"] = "待部门并审";
|
|
|
+ if ($item["resubmit"]) {
|
|
|
+ $item["checkState"] = "待部门并审(重新提交)";
|
|
|
+ } else {
|
|
|
+ $item["checkState"] = "待部门并审(首次提交)";
|
|
|
+ }
|
|
|
}
|
|
|
if ($item["active"] == 1 && $item["new_state"] == TalentState::DEPT_VERIFY_PASS) {
|
|
|
$item["checkState"] = "部门并审通过";
|
|
@@ -925,7 +954,11 @@ class VerifyApi {
|
|
|
if ($process == 3) {
|
|
|
$item["checkState"] = "初审通过(待部门并审)";
|
|
|
} else {
|
|
|
- $item["checkState"] = "待部门并审";
|
|
|
+ if ($item["resubmit"]) {
|
|
|
+ $item["checkState"] = "待部门并审(重新提交)";
|
|
|
+ } else {
|
|
|
+ $item["checkState"] = "待部门并审(首次提交)";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|