瀏覽代碼

初审通过状态增加通过初审以上状态,部门审核列表重复记录删除

sugangqiang 2 年之前
父節點
當前提交
2b569fbb88
共有 1 個文件被更改,包括 9 次插入7 次删除
  1. 9 7
      app/common/api/VerifyApi.php

+ 9 - 7
app/common/api/VerifyApi.php

@@ -227,13 +227,13 @@ class VerifyApi {
         $count = 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,mainId,`type`)) in (select md5(concat(max(createTime),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("(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")
                         ->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,mainId,`type`)) in (select md5(concat(max(createTime),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("(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")
                         ->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")
@@ -443,7 +443,8 @@ class VerifyApi {
                             $where[] = ["tl.state", "=", TalentState::FST_VERIFY_REJECT];
                             break;
                         case 3://通过
-                            $where[] = ["tl.state", "in", [TalentState::FST_VERIFY_PASS]];
+                            //$where[] = ["tl.state", "in", [TalentState::FST_VERIFY_PASS]];
+                            $whereRaw = sprintf("tl.state=%d or tl.state>%d", TalentState::FST_VERIFY_PASS, TalentState::FST_VERIFY_REJECT);
                             break;
                         case 4://失败
                             $where[] = ["tl.state", "in", [TalentState::FST_VERIFY_FAIL]];
@@ -454,7 +455,7 @@ class VerifyApi {
                             break;
                         default:
                             //$where[] = ["tl.state", "in", [TalentState::SCND_SUBMIT, TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT, TalentState::FST_VERIFY_REJECT]];
-                            $whereRaw = sprintf("((tl.new_state=%d and ti.`delete`=0) or tl.new_state=%d or tl.state in (%d,%d))", TalentState::SCND_SAVE, TalentState::SCND_SUBMIT, TalentState::FST_VERIFY_PASS, TalentState::FST_VERIFY_FAIL);
+                            $whereRaw = sprintf("((tl.new_state=%d and ti.`delete`=0) or tl.new_state=%d or tl.state in (%d,%d) or tl.state>%d)", TalentState::SCND_SAVE, TalentState::SCND_SUBMIT, TalentState::FST_VERIFY_PASS, TalentState::FST_VERIFY_FAIL, TalentState::FST_VERIFY_REJECT);
                     }
                     break;
                 case 6:
@@ -660,7 +661,8 @@ class VerifyApi {
                             $where[] = ["tl.state", "=", TalentState::FST_VERIFY_REJECT];
                             break;
                         case 3://通过
-                            $where[] = ["tl.state", "in", [TalentState::FST_VERIFY_PASS]];
+                            //$where[] = ["tl.state", "in", [TalentState::FST_VERIFY_PASS]];
+                            $whereRaw = sprintf("tl.state=%d or tl.state>%d", TalentState::FST_VERIFY_PASS, TalentState::FST_VERIFY_REJECT);
                             break;
                         case 4://失败
                             $where[] = ["tl.state", "in", [TalentState::FST_VERIFY_FAIL]];
@@ -671,7 +673,7 @@ class VerifyApi {
                             break;
                         default:
                             //$where[] = ["tl.state", "in", [TalentState::SCND_SUBMIT, TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT, TalentState::FST_VERIFY_REJECT]];
-                            $whereRaw = sprintf("((tl.new_state=%d and ti.`delete`=0) or tl.new_state=%d or tl.state in (%d,%d))", TalentState::SCND_SAVE, TalentState::SCND_SUBMIT, TalentState::FST_VERIFY_PASS, TalentState::FST_VERIFY_FAIL);
+                            $whereRaw = sprintf("((tl.new_state=%d and ti.`delete`=0) or tl.new_state=%d or tl.state in (%d,%d) or tl.state>%d)", TalentState::SCND_SAVE, TalentState::SCND_SUBMIT, TalentState::FST_VERIFY_PASS, TalentState::FST_VERIFY_FAIL, TalentState::FST_VERIFY_REJECT);
                     }
                     break;
                 case 4:
@@ -762,7 +764,7 @@ class VerifyApi {
                 $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,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`=3 and companyId='{$companyId}' and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ti.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")
                                 ->where($where)
                                 ->whereRaw("find_in_set(:companyId,companyIds)", ["companyId" => $companyId])
                                 ->field($fields)