浏览代码

导出逻辑修改

sugangqiang 2 年之前
父节点
当前提交
be0e07bdbb

+ 14 - 17
app/admin/controller/Talent.php

@@ -73,9 +73,6 @@ class Talent extends AdminController {
 //            $str .= $item . "<br />";
 //            $str .= $item . "<br />";
 //        }
 //        }
 //        $info['shenbao'] =  "该人员社保填写日期为{$tmp_time[0]}至{$tmp_time[1]},共" . count($formatDate) . "个月,接口返回{$api_test['data']['totalCount']}个月数据,分别为:<br />$str";
 //        $info['shenbao'] =  "该人员社保填写日期为{$tmp_time[0]}至{$tmp_time[1]},共" . count($formatDate) . "个月,接口返回{$api_test['data']['totalCount']}个月数据,分别为:<br />$str";
-
-
-
         //dd($tmp_time,diffDate($tmp_time[0],$tmp_time[1]));
         //dd($tmp_time,diffDate($tmp_time[0],$tmp_time[1]));
         if ($force || !$api_data || !$api_data['status']) {
         if ($force || !$api_data || !$api_data['status']) {
             ApiData::where('uid', '=', $info['card_number'])->where('action', '=', 'rending')->where('status', '=', 1)->update(['status' => 0, 'updateTime' => time()]);
             ApiData::where('uid', '=', $info['card_number'])->where('action', '=', 'rending')->where('status', '=', 1)->update(['status' => 0, 'updateTime' => time()]);
@@ -84,16 +81,16 @@ class Talent extends AdminController {
                 $content = [];
                 $content = [];
                 $info['rs']['I010902'] = $content['I010902'] = $rsapi->I010902($info['card_number']);
                 $info['rs']['I010902'] = $content['I010902'] = $rsapi->I010902($info['card_number']);
                 $info['rs']['I030101'] = $content['I030101'] = $rsapi->I030101($info['card_number']);
                 $info['rs']['I030101'] = $content['I030101'] = $rsapi->I030101($info['card_number']);
-                $tmp_time = explode(' - ',$info['tax_insurance_month']);
-                $content['YL00018'] = $rsapi->YL00018($info['card_number'],str_replace('-','',$tmp_time[0]),str_replace('-','',$tmp_time[1]));
-                $formatDate = formatDateByMonth($tmp_time[0],$tmp_time[1],$content['YL00018']['data']['list']);
+                $tmp_time = explode(' - ', $info['tax_insurance_month']);
+                $content['YL00018'] = $rsapi->YL00018($info['card_number'], str_replace('-', '', $tmp_time[0]), str_replace('-', '', $tmp_time[1]));
+                $formatDate = formatDateByMonth($tmp_time[0], $tmp_time[1], $content['YL00018']['data']['list']);
                 $str = '';
                 $str = '';
-                foreach ($formatDate as $tmp_item){
+                foreach ($formatDate as $tmp_item) {
                     $str .= $tmp_item . "<br />";
                     $str .= $tmp_item . "<br />";
                 }
                 }
-                if(count($formatDate) == $content['YL00018']['data']['totalCount']){
+                if (count($formatDate) == $content['YL00018']['data']['totalCount']) {
                     $content['YL00018']['status'] = 'success';
                     $content['YL00018']['status'] = 'success';
-                }else{
+                } else {
                     $content['YL00018']['status'] = 'warning';
                     $content['YL00018']['status'] = 'warning';
                 }
                 }
                 $content['YL00018']['content'] = "该人员社保填写日期为{$tmp_time[0]}至{$tmp_time[1]},共" . count($formatDate) . "个月,接口返回{$content['YL00018']['data']['totalCount']}个月数据,分别为:<br />$str";
                 $content['YL00018']['content'] = "该人员社保填写日期为{$tmp_time[0]}至{$tmp_time[1]},共" . count($formatDate) . "个月,接口返回{$content['YL00018']['data']['totalCount']}个月数据,分别为:<br />$str";
@@ -110,22 +107,22 @@ class Talent extends AdminController {
             }
             }
         } else {
         } else {
             $content = unserialize($api_data['content']);
             $content = unserialize($api_data['content']);
-            if(array_key_exists('YL00018',$content)){
-                $tmp_time = explode(' - ',$info['tax_insurance_month']);
-                $formatDate = formatDateByMonth($tmp_time[0],$tmp_time[1],$content['YL00018']['data']['list']);
+            if (array_key_exists('YL00018', $content)) {
+                $tmp_time = explode(' - ', $info['tax_insurance_month']);
+                $formatDate = formatDateByMonth($tmp_time[0], $tmp_time[1], $content['YL00018']['data']['list']);
                 $str = '';
                 $str = '';
-                foreach ($formatDate as $tmp_item){
+                foreach ($formatDate as $tmp_item) {
                     $str .= $tmp_item . "<br />";
                     $str .= $tmp_item . "<br />";
                 }
                 }
-                if(count($formatDate) == $content['YL00018']['data']['totalCount']){
+                if (count($formatDate) == $content['YL00018']['data']['totalCount']) {
                     $content['YL00018']['status'] = 'success';
                     $content['YL00018']['status'] = 'success';
-                }else{
+                } else {
                     $content['YL00018']['status'] = 'warning';
                     $content['YL00018']['status'] = 'warning';
                 }
                 }
                 $content['YL00018']['content'] = "该人员社保填写日期为{$tmp_time[0]}至{$tmp_time[1]},共" . count($formatDate) . "个月,接口返回{$content['YL00018']['data']['totalCount']}个月数据,分别为:<br />$str";
                 $content['YL00018']['content'] = "该人员社保填写日期为{$tmp_time[0]}至{$tmp_time[1]},共" . count($formatDate) . "个月,接口返回{$content['YL00018']['data']['totalCount']}个月数据,分别为:<br />$str";
                 unset($tmp_time);
                 unset($tmp_time);
                 unset($tmp_item);
                 unset($tmp_item);
-            }else{
+            } else {
                 $content['YL00018'] = [];
                 $content['YL00018'] = [];
             }
             }
             $info['rs'] = $content;
             $info['rs'] = $content;
@@ -1731,7 +1728,7 @@ class Talent extends AdminController {
         $names["street"] = "所属镇街";
         $names["street"] = "所属镇街";
         $names["checkState"] = "审核状态";
         $names["checkState"] = "审核状态";
         $names["checkMsg"] = "审核意见";
         $names["checkMsg"] = "审核意见";
-        $list = VerifyApi::getExportDatas($process, $fields);
+        $list = VerifyApi::getExportDatas($process, $params);
         foreach ($fields as $field) {
         foreach ($fields as $field) {
             $columns[] = $names[$field];
             $columns[] = $names[$field];
         }
         }

+ 2 - 1
app/admin/view/talent/fst_verify.html

@@ -451,7 +451,8 @@
                 </form>
                 </form>
             </div>
             </div>
             <div class="modal-footer">
             <div class="modal-footer">
-                <button type="button" class="btn btn-primary" onclick="TalentInfo.export(3)">导出</button>
+                <button type="button" class="btn btn-primary" onclick="TalentInfo.export(3)">导出查找内容</button>
+                <button type="button" class="btn btn-primary" onclick="TalentInfo.export(3, true)">导出全部</button>
                 <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                 <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
             </div>
             </div>
         </div>
         </div>

+ 3 - 3
app/common/api/TalentState.php

@@ -75,11 +75,11 @@ class TalentState {
             case 13:
             case 13:
                 return "部门并审驳回";
                 return "部门并审驳回";
             case 14:
             case 14:
-                return "复成功";
+                return "复成功";
             case 15:
             case 15:
-                return "复驳回";
+                return "复驳回";
             case 16:
             case 16:
-                return "复不通过";
+                return "复不通过";
             case -1:
             case -1:
                 return "基础审核不通过";
                 return "基础审核不通过";
             case -2:
             case -2:

+ 232 - 55
app/common/api/VerifyApi.php

@@ -446,10 +446,11 @@ class VerifyApi {
     public static function getExportDatas($process, $params) {
     public static function getExportDatas($process, $params) {
         $where[] = [];
         $where[] = [];
         //特殊字段处理
         //特殊字段处理
+        $exportFields = $params["export"];
         $fields = [];
         $fields = [];
-        foreach ($params as $param) {
-            if (!in_array($param, ["industryFieldNew", "enterpriseName", "enterpriseTag", "street", "talent_arrange_category", "checkMsg"])) {
-                $fields[] = "ti." . $param;
+        foreach ($exportFields as $field) {
+            if (!in_array($field, ["industryFieldNew", "enterpriseName", "enterpriseTag", "street", "talent_arrange_category", "checkMsg"])) {
+                $fields[] = "ti." . $field;
             }
             }
         }
         }
         $fields[] = "e.name as enterpriseName";
         $fields[] = "e.name as enterpriseName";
@@ -460,49 +461,49 @@ class VerifyApi {
         $fields[] = "tl.description as checkMsg";
         $fields[] = "tl.description as checkMsg";
         $fields[] = "tc.name as talentConditionName";
         $fields[] = "tc.name as talentConditionName";
         $fields[] = "tl.description as checkMsg";
         $fields[] = "tl.description as checkMsg";
-        if (in_array("card_type", $params)) {
+        if (in_array("card_type", $exportFields)) {
             $cardTypes = DictApi::selectByParentCode("card_type");
             $cardTypes = DictApi::selectByParentCode("card_type");
         }
         }
-        if (in_array("industryFieldNew", $params)) {
+        if (in_array("industryFieldNew", $exportFields)) {
             $industry_fields = DictApi::selectByParentCode("industry_field");
             $industry_fields = DictApi::selectByParentCode("industry_field");
         }
         }
-        if (in_array("enterpriseTag", $params)) {
+        if (in_array("enterpriseTag", $exportFields)) {
             $enterpriseTags = DictApi::selectByParentCode("enterprise_tag");
             $enterpriseTags = DictApi::selectByParentCode("enterprise_tag");
         }
         }
-        if (in_array("street", $params)) {
+        if (in_array("street", $exportFields)) {
             $streets = DictApi::selectByParentCode("street");
             $streets = DictApi::selectByParentCode("street");
         }
         }
-        if (in_array("nation", $params)) {
+        if (in_array("nation", $exportFields)) {
             $nations = DictApi::selectByParentCode("nation");
             $nations = DictApi::selectByParentCode("nation");
         }
         }
-        if (in_array("nationality", $params)) {
+        if (in_array("nationality", $exportFields)) {
             $nationalitys = DictApi::selectByParentCode("nationality");
             $nationalitys = DictApi::selectByParentCode("nationality");
         }
         }
-        if (in_array("politics", $params)) {
+        if (in_array("politics", $exportFields)) {
             $politics = DictApi::selectByParentCode("politics");
             $politics = DictApi::selectByParentCode("politics");
         }
         }
-        if (in_array("talent_type", $params)) {
+        if (in_array("talent_type", $exportFields)) {
             $talentTypes = DictApi::selectByParentCode("talent_type");
             $talentTypes = DictApi::selectByParentCode("talent_type");
         }
         }
-        if (in_array("talent_arrange_category", $params)) {
+        if (in_array("talent_arrange_category", $exportFields)) {
             $talentArrangeCategories = DictApi::selectByParentCode("talent_condition_cats");
             $talentArrangeCategories = DictApi::selectByParentCode("talent_condition_cats");
         }
         }
-        if (in_array("highest_degree", $params)) {
+        if (in_array("highest_degree", $exportFields)) {
             $highest_degree = DictApi::selectByParentCode("highest_degree");
             $highest_degree = DictApi::selectByParentCode("highest_degree");
         }
         }
-        if (in_array("import_way", $params)) {
+        if (in_array("import_way", $exportFields)) {
             $import_way = DictApi::selectByParentCode("import_way");
             $import_way = DictApi::selectByParentCode("import_way");
         }
         }
-        if (in_array("source", $params)) {
+        if (in_array("source", $exportFields)) {
             $source = DictApi::selectByParentCode("source");
             $source = DictApi::selectByParentCode("source");
         }
         }
-        if (in_array("source_city", $params)) {
+        if (in_array("source_city", $exportFields)) {
             $source_city = DictApi::selectByParentCode("source_city");
             $source_city = DictApi::selectByParentCode("source_city");
         }
         }
-        if (in_array("source_county", $params)) {
+        if (in_array("source_county", $exportFields)) {
             $source_county = DictApi::selectByParentCode("source_county");
             $source_county = DictApi::selectByParentCode("source_county");
         }
         }
-        if (in_array("talent_arrange", $params)) {
+        if (in_array("talent_arrange", $exportFields)) {
             $talent_arrange = DictApi::selectByParentCode("talent_arrange");
             $talent_arrange = DictApi::selectByParentCode("talent_arrange");
         }
         }
         $sex = [1 => "男", 2 => "女"];
         $sex = [1 => "男", 2 => "女"];
@@ -514,38 +515,199 @@ class VerifyApi {
 
 
         $where = [];
         $where = [];
         $where[] = ["e.type", "=", session("user")["type"]];
         $where[] = ["e.type", "=", session("user")["type"]];
-        switch ($process) {
-            case 1:
-                $where = "ti.checkState in (" . TalentState::FST_SUBMIT . "," . TalentState::BASE_VERIFY_FAIL . ")";
-                break;
-            case 2:
-                $where = "ti.checkState in (" . TalentState::BASE_VERIFY_PASS . "," . TalentState::BASE_REVERIFY_FAIL . ")";
-                break;
-            case 3:
-                $where = "ti.checkState in (" . TalentState::SCND_SUBMIT . "," . TalentState::FST_VERIFY_FAIL . ")";
-                break;
-            case 4:
-                $companyId = session("user")["companyId"];
-                $where = "ti.checkState = " . TalentState::FST_VERIFY_PASS . " and ti.pass_dept_check=0 and find_in_set({$companyId},tc.companyIds)";
-                break;
-            case 5:
-                $where = sprintf("(ti.checkState in (%d,%d,%d)) or (ti.checkState=%d and ti.pass_dept_check=0) or (ti.checkState=%d and ti.pass_dept_check=1) or (ti.checkState=%d and (tc.companyIds is null or tc.companyIds = ''))", TalentState::REVERIFY_PASS, TalentState::REVERIFY_REJECT, TalentState::REVERIFY_FAIL, TalentState::DEPT_VERIFY_PASS, TalentState::FST_VERIFY_PASS, TalentState::FST_VERIFY_PASS);
-                break;
-            case 6:
-                $where = "ti.checkState >= " . TalentState::REVERIFY_PASS;
-                break;
-            case 7:
-                $where = "ti.checkState = " . TalentState::CERTIFICATED;
-                break;
+        if ($params["all"] != 1) {
+            if ($params["name"]) {
+                $where[] = ["ti.name", "like", "%{$params["name"]}%"];
+            }
+            if ($params["card_number"]) {
+                $where[] = ["ti.card_number", "like", "%" . $params["card_number"] . "%"];
+            }
+            if ($params["sex"]) {
+                $where[] = ["ti.sex", "=", $params["sex"]];
+            }
+            if ($params["nation"]) {
+                $where[] = ["ti.nation", "=", $params["nation"]];
+            }
+            if ($params["apply_year"]) {
+                $where[] = ["ti.apply_year", "like", "{$params["apply_year"]}%"];
+            }
+            if ($params["phone"]) {
+                $where[] = ["ti.phone", "like", "%{$params["phone"]}%"];
+            }
+            if ($params["email"]) {
+                $where[] = ["ti.email", "like", "%{$params["email"]}%"];
+            }
+            if ($params["nationality"]) {
+                $where[] = ["ti.nationality", "=", $params["nationality"]];
+            }
+            if ($params["province"]) {
+                $where[] = ["ti.province", "=", $params["province"]];
+            }
+            if ($params["politics"]) {
+                $where[] = ["ti.politics", "=", $params["politics"]];
+            }
+            if ($params["enterprise_id"]) {
+                $where[] = ["ti.enterprise_id", "=", $params["enterprise_id"]];
+            }
+            if ($params["street"]) {
+                $where[] = ["e.street", "=", $params["street"]];
+            }
+            if ($params["industry_field"]) {
+                $where[] = ["e.industryFieldNew", "=", $params["industry_field"]];
+            }
+            if ($params["industry_field_old"]) {
+                $where[] = ["e.industryFieldOld", "=", $params["industry_field_old"]];
+            }
+            if ($params["enterprise_tag"]) {
+                $where[] = ["e.enterpriseTag", "=", $params["enterprise_tag"]];
+            }
+            if ($params["talent_type"]) {
+                $where[] = ["ti.talent_type", "=", $params["talent_type"]];
+            }
+            if ($params["import_way"]) {
+                $where[] = ["ti.import_way", "=", $params["import_way"]];
+            }
+            if ($params["highest_degree"]) {
+                $where[] = ["ti.highest_degree", "=", $params["highest_degree"]];
+            }
+            if ($params["study_abroad"]) {
+                $where[] = ["ti.study_abroad", "=", $params["study_abroad"]];
+            }
+            if ($params["source"]) {
+                $where[] = ["ti.source", "=", $params["source"]];
+            }
+            if ($params["talent_arrange"]) {
+                $where[] = ["ti.talent_arrange", "=", $params["talent_arrange"]];
+            }
+            if ($params["talent_condition"]) {
+                $where[] = ["ti.talent_condition", "=", $params["talent_condition"]];
+            }
+            if ($params["isMatchZhiren"]) {
+                $where[] = ["ti.isMatchZhiren", "=", $params["isMatchZhiren"]];
+            }
+            switch ($process) {
+                case 1:
+                    $where[] = ["ti.checkState", "in", [TalentState::FST_SUBMIT, TalentState::BASE_VERIFY_FAIL]];
+                    break;
+                case 2:
+                    $where[] = ["ti.checkState", "in", [TalentState::BASE_VERIFY_PASS, TalentState::BASE_REVERIFY_FAIL]];
+                    break;
+                case 3:
+                    switch ($params["checkState"]) {
+                        case -1://保存未提交
+                            $where[] = ["tl.new_state", "=", TalentState::SCND_SAVE];
+                            $where[] = ["tl.state", "<>", TalentState::FST_VERIFY_REJECT];
+                            //$where[] = ["ti.first_submit_time", "exp", Db::raw("is null")];
+                            $where[] = ["ti.delete", "=", 0];
+                            break;
+                        case 1://待审核
+                            $where[] = ["ti.checkState", "=", TalentState::SCND_SUBMIT];
+                            //$where[] = ["tl.state", "in", [TalentState::SCND_SUBMIT, TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT]];
+                            $where[] = ["tl.last_state", "<>", TalentState::FST_VERIFY_REJECT];
+                            break;
+                        case 2://驳回
+                            //$where[] = ["ti.checkState", "=", TalentState::SCND_SUBMIT];
+                            $where[] = ["tl.new_state", "=", TalentState::SCND_SAVE];
+                            $where[] = ["tl.state", "=", TalentState::FST_VERIFY_REJECT];
+                            break;
+                        case 3://通过
+                            $where[] = ["tl.state", "in", [TalentState::FST_VERIFY_PASS]];
+                            break;
+                        case 4://失败
+                            $where[] = ["tl.state", "in", [TalentState::FST_VERIFY_FAIL]];
+                            break;
+                        case 5://重新提交
+                            $where[] = ["ti.checkState", "=", TalentState::SCND_SUBMIT];
+                            $where[] = ["tl.last_state", "=", TalentState::FST_VERIFY_REJECT];
+                            break;
+                        default:
+                            //$where[] = ["ti.checkState", "in", [TalentState::SCND_SUBMIT, TalentState::FST_VERIFY_FAIL]];
+                            //$where[] = ["tl.new_state", "in", [TalentState::SCND_SAVE, TalentState::SCND_SUBMIT]];
+                            $where[] = ["tl.state", "in", [TalentState::SCND_SUBMIT, TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT, TalentState::FST_VERIFY_REJECT]];
+                    }
+                    break;
+                case 4:
+                    switch ($params["checkState"]) {
+                        case 5:
+                            $_where = [];
+                            $_where[] = ["type", "=", 1];
+                            $_where[] = ["active", "=", 1];
+                            $_where[] = ["step", "=", 3];
+                            $_where[] = ["companyId", "=", session("user")["companyId"]];
+                            $mainIds = \app\common\model\TalentChecklog::where($_where)->group("mainId")->order("createTime desc")->column("mainId");
+                            if ($mainIds) {
+                                $where[] = ["ti.id", "in", $mainIds];
+                            } else {
+                                $where[] = ["ti.checkState", "=", TalentState::FST_VERIFY_PASS];
+                                $where[] = ["ti.pass_dept_check", "=", 0];
+                            }
+                            break;
+                        default:
+                            $where[] = ["ti.checkState", "=", TalentState::FST_VERIFY_PASS];
+                            $where[] = ["ti.pass_dept_check", "=", 0];
+                            break;
+                    }
+                    break;
+                case 5:
+                    $whereRaw = sprintf("(ti.checkState in (14,15,16)) or (ti.checkState=12 and ti.pass_dept_check=0) or (ti.checkState=10 and ti.pass_dept_check=1) or (ti.checkState=10 and (tc.companyIds is null or tc.companyIds = ''))");
+                    switch ($params["checkState"]) {
+                        case 1:
+                            $where[] = ["ti.checkState", "in", [TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
+                            break;
+                        case -1:
+                            $where[] = ["ti.checkState", "=", TalentState::REVERIFY_FAIL];
+                            break;
+                    }
+                    break;
+                case 6:
+                    $where[] = ["ti.checkState", ">=", TalentState::REVERIFY_PASS];
+                    if ($params["checkState"]) {
+                        $where[] = ["ti.checkState", "=", $params["checkState"]];
+                    }
+                    break;
+                case 7:
+                    $where[] = ["ti.checkState", "=", TalentState::CERTIFICATED];
+                    break;
+            }
+        } else {
+            $where[] = ["ti.delete", "=", 0];
+        }
+        $fields[] = "ti.pass_dept_check";
+        $fields[] = "tl.state";
+        $fields[] = "tl.new_state";
+        $fields[] = "tl.last_state";
+        $fields[] = "tc.companyIds";
+        if ($process == 4) {
+            $companyId = session("user")["companyId"];
+            $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 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)")
+                            ->where($where)
+                            ->whereRaw("find_in_set(:companyId,companyIds)", ["companyId" => $companyId])
+                            ->field($fields)
+                            ->select()->toArray();
+        } else if ($process == 5) {
+            $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)")
+                            ->whereRaw($whereRaw)
+                            ->where($where)
+                            ->field($fields)
+                            ->select()->toArray();
+        } else {
+            $list = Talent::alias("ti")
+                            ->field($fields)
+                            ->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)")
+                            ->where($where)
+                            ->select()->toArray();
         }
         }
-        $list = Talent::alias("ti")
-                        ->field($fields)
-                        ->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)")
-                        ->whereRaw($where)
-                        ->select()->toArray();
         foreach ($list as &$item) {
         foreach ($list as &$item) {
             $item["card_type"] = $cardTypes[$item["card_type"]];
             $item["card_type"] = $cardTypes[$item["card_type"]];
             $item["industryFieldNew"] = $industry_fields[$item["industryFieldNew"]];
             $item["industryFieldNew"] = $industry_fields[$item["industryFieldNew"]];
@@ -567,22 +729,37 @@ class VerifyApi {
             $item["source"] = $source[$item["source"]];
             $item["source"] = $source[$item["source"]];
             $item["talent_arrange"] = $talent_arrange[$item["talent_arrange"]];
             $item["talent_arrange"] = $talent_arrange[$item["talent_arrange"]];
             $item["talent_condition"] = $item["talentConditionName"];
             $item["talent_condition"] = $item["talentConditionName"];
-            if (in_array("source_city", $params)) {
+            if (in_array("source_city", $exportFields)) {
                 $item["source_city"] = Db::table("un_common_location")->where("code", "=", $item["source_city"])->findOrEmpty()["name"];
                 $item["source_city"] = Db::table("un_common_location")->where("code", "=", $item["source_city"])->findOrEmpty()["name"];
             }
             }
-            if (in_array("source_county", $params)) {
+            if (in_array("source_county", $exportFields)) {
                 $item["source_county"] = Db::table("un_common_location")->where("code", "=", $item["source_county"])->findOrEmpty()["name"];
                 $item["source_county"] = Db::table("un_common_location")->where("code", "=", $item["source_county"])->findOrEmpty()["name"];
             }
             }
-            if (in_array("province", $params)) {
+            if (in_array("province", $exportFields)) {
                 $item["province"] = Db::table("un_common_location")->where("code", "=", $item["province"])->findOrEmpty()["name"];
                 $item["province"] = Db::table("un_common_location")->where("code", "=", $item["province"])->findOrEmpty()["name"];
             }
             }
-            if (in_array("city", $params)) {
+            if (in_array("city", $exportFields)) {
                 $item["city"] = Db::table("un_common_location")->where("code", "=", $item["city"])->findOrEmpty()["name"];
                 $item["city"] = Db::table("un_common_location")->where("code", "=", $item["city"])->findOrEmpty()["name"];
             }
             }
-            if (in_array("county", $params)) {
+            if (in_array("county", $exportFields)) {
                 $item["county"] = Db::table("un_common_location")->where("code", "=", $item["county"])->findOrEmpty()["name"];
                 $item["county"] = Db::table("un_common_location")->where("code", "=", $item["county"])->findOrEmpty()["name"];
             }
             }
-            $item["checkState"] = TalentState::getStateName($item["checkState"]);
+            if ($item["state"] == TalentState::SCND_SUBMIT) {
+                if ($item["last_state"] == TalentState::FST_VERIFY_REJECT) {
+                    $item["checkState"] = "待审核(重新提交)";
+                } else {
+                    $item["checkState"] = "待初审";
+                }
+            } else if ($item["state"] == TalentState::FST_VERIFY_PASS) {
+                if (!$item["companyIds"] || $item["pass_dept_check"] == 1) {
+                    $item["checkState"] = "初审通过,待复审";
+                }
+                if ($item["pass_dept_check"] == 0) {
+                    $item["checkState"] = "初审通过,待部门审核";
+                }
+            } else {
+                $item["checkState"] = TalentState::getStateName($item["state"]);
+            }
         }unset($item);
         }unset($item);
         return $list;
         return $list;
     }
     }

+ 8 - 3
public/static/modular/talentIdentify/talentInfo/talentInfo_common.js

@@ -38,7 +38,6 @@ TalentInfo.formParams = function () {
     queryData['import_way'] = $("#import_way").val();
     queryData['import_way'] = $("#import_way").val();
     queryData['highest_degree'] = $("#highest_degree").val();
     queryData['highest_degree'] = $("#highest_degree").val();
     queryData['major'] = $("#major").val();
     queryData['major'] = $("#major").val();
-    queryData['title'] = $("#title").val();
     queryData['study_abroad'] = $("#study_abroad").val();
     queryData['study_abroad'] = $("#study_abroad").val();
     queryData['phone'] = $("#phone").val();
     queryData['phone'] = $("#phone").val();
     queryData['email'] = $("#email").val();
     queryData['email'] = $("#email").val();
@@ -88,7 +87,6 @@ TalentInfo.reset = function () {
     $("#import_way").val("");
     $("#import_way").val("");
     $("#highest_degree").val("");
     $("#highest_degree").val("");
     $("#major").val("");
     $("#major").val("");
-    $("#title").val("");
     $("#study_abroad").val("");
     $("#study_abroad").val("");
     $("#phone").val("");
     $("#phone").val("");
     $("#email").val("");
     $("#email").val("");
@@ -151,7 +149,8 @@ TalentInfo.showExportModal = function () {
 /**
 /**
  * 导出提交
  * 导出提交
  */
  */
-TalentInfo.export = function (process) {
+TalentInfo.export = function (process, exportAll) {
+    exportAll = typeof exportAll == "undefined" || exportAll == false ? 0 : 1;
     var names = '';
     var names = '';
     var values = '';
     var values = '';
     var commonExport = "";
     var commonExport = "";
@@ -189,6 +188,12 @@ TalentInfo.export = function (process) {
     $("#commonExportModal").modal('hide');
     $("#commonExportModal").modal('hide');
     var params = $("#exportForm").serialize();
     var params = $("#exportForm").serialize();
     var url = "/admin/talent/" + commonExport + "?" + params;
     var url = "/admin/talent/" + commonExport + "?" + params;
+    Object.keys(queryData).forEach(function (key, index) {
+        if (typeof queryData[key] != "undefined" && queryData[key]) {
+            url += "&" + key + "=" + queryData[key];
+        }
+    })
+    url += "&all=" + exportAll;
     window.location.href = url;
     window.location.href = url;
 }
 }