|
@@ -220,6 +220,7 @@ class TalentApi {
|
|
if ($talentArrange) {
|
|
if ($talentArrange) {
|
|
$where[] = ["ti.talent_arrange", "=", $talentArrange];
|
|
$where[] = ["ti.talent_arrange", "=", $talentArrange];
|
|
}
|
|
}
|
|
|
|
+ $whereRaw = sprintf("tl.state in (%s,%s) or tl.state >= %s", TalentState::FST_SUBMIT, TalentState::BASE_REJECT, TalentState::SCND_SUBMIT);
|
|
switch ($checkState) {
|
|
switch ($checkState) {
|
|
case 1:
|
|
case 1:
|
|
$where[] = ["tl.state", "=", TalentState::FST_SUBMIT];
|
|
$where[] = ["tl.state", "=", TalentState::FST_SUBMIT];
|
|
@@ -230,15 +231,12 @@ class TalentApi {
|
|
case 3:
|
|
case 3:
|
|
$where[] = ["tl.state", ">=", TalentState::SCND_SUBMIT];
|
|
$where[] = ["tl.state", ">=", TalentState::SCND_SUBMIT];
|
|
break;
|
|
break;
|
|
- default:
|
|
|
|
- $where[] = ["tl.state", "in", [TalentState::FST_SUBMIT, TalentState::BASE_REJECT]];
|
|
|
|
- $where[] = ["tl.state", ">=", TalentState::SCND_SUBMIT];
|
|
|
|
}
|
|
}
|
|
- $count = Talent::where($where)->alias("ti")
|
|
|
|
|
|
+ $count = Talent::where($where)->whereRaw($whereRaw)->alias("ti")
|
|
->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
|
|
->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("(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")
|
|
->count();
|
|
->count();
|
|
- $list = Talent::where($where)->alias("ti")
|
|
|
|
|
|
+ $list = Talent::where($where)->whereRaw($whereRaw)->alias("ti")
|
|
->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
|
|
->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("(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")
|
|
->field("ti.*,e.name as enterpriseName,e.type")
|
|
->field("ti.*,e.name as enterpriseName,e.type")
|