Browse Source

更新一些修改

sandm 2 years ago
parent
commit
53cd7df9a8
2 changed files with 32 additions and 14 deletions
  1. 30 12
      app/common/api/EnterpriseApi.php
  2. 2 2
      app/job/Import.php

+ 30 - 12
app/common/api/EnterpriseApi.php

@@ -180,12 +180,25 @@ class EnterpriseApi {
                 $whr[] = ["companyId", "=", $companyId];
                 $whr[] = ["delete", "=", 0];
                 $list = \app\common\model\EnterpriseVerifyMgr::where($whr)->select()->toArray();
-                $talentType = [];
+                $talentType = []; //查找单位对应标签
+                $org = [];
+                $ins = [];
                 $uniCodes = [];
                 foreach ($list as $k => $v) {
-                    array_push($talentType, $v['enterpriseTag']);
-                    $codes = explode(",", $v["uniCode"]);
-                    $uniCodes = array_merge($uniCodes, (array) $codes);
+                    if(!empty($v['enterpriseTag'])){
+                        array_push($talentType, $v['enterpriseTag']);
+                    }
+                    if(!empty($v['organizationTag'])){
+                        array_push($org, $v['organizationTag']);
+                    }
+                    if(!empty($v['institutionTag'])){
+                        array_push($ins, $v['institutionTag']);
+                    }
+                    if(!empty($v["uniCode"])){
+                        $codes = explode(",", $v["uniCode"]);
+                        $uniCodes = array_merge($uniCodes, (array) $codes);
+                    }
+
                 }
 
                 $_whr[] = ["uniCode", "<>", ""];
@@ -197,22 +210,27 @@ class EnterpriseApi {
                     $codes = explode(",", $_v["uniCode"]);
                     $expUniCodes = array_merge($expUniCodes, (array) $codes);
                 }
-                if ($talentType && $uniCodes) {
+                if (($talentType || $org || $ins) && $uniCodes) {
                     if ($expUniCodes) {
-                        $whereRaw = sprintf('(newEnterpriseTag in ("%s") and newIdCard not in ("%s")) or newIdCard in ("%s")', implode('","', $talentType), implode('","', $expUniCodes), implode('","', $uniCodes));
+                        $whereRaw = sprintf('(newEnterpriseTag in ("%s") and newOrganizationTag in ("%s") and newInstitutionTag in ("%s") and newIdCard not in ("%s")) or newIdCard in ("%s")', implode('","', $talentType), implode('","', $org), implode('","', $ins), implode('","', $expUniCodes), implode('","', $uniCodes));
                     } else {
-                        $whereRaw = sprintf('newEnterpriseTag in ("%s") or newIdCard in ("%s")', implode('","', $talentType), implode('","', $uniCodes));
+                        $whereRaw = sprintf('newEnterpriseTag in ("%s") and newOrganizationTag in ("%s") and newInstitutionTag in ("%s") or newIdCard in ("%s")', implode('","', $talentType), implode('","', $org), implode('","', $ins), implode('","', $uniCodes));
                     }
                 }
-                if ($talentType && !$uniCodes) {
-                    $where[] = ["newEnterpriseTag", "in", $talentType];
+                if (($talentType || $org || $ins) && !$uniCodes) {
+                    if($talentType){
+                        $where[] = ["newEnterpriseTag", "in", $talentType];
+                    }
+                    if($org){
+                        $where[] = ["newOrganizationTag", "in", $org];
+                    }
+                    if($ins){
+                        $where[] = ["newInstitutionTag", "in", $ins];
+                    }
                     if ($expUniCodes) {
                         $where[] = ["newIdCard", "not in", $expUniCodes];
                     }
                 }
-                if (!$talentType && $uniCodes) {
-                    $where[] = ["newIdCard", "in", $uniCodes];
-                }
             }
         }
 

+ 2 - 2
app/job/Import.php

@@ -238,7 +238,7 @@ class Import {
                                     break;
                             }
                         }
-                        $item["checkState"] = \app\common\api\TalentState::REVERIFY_PASS; //复审通过
+                        $item["checkState"] = \app\common\api\TalentState::SCND_SAVE; //保存未提交
                         $item["highProcess"] = 5; //最高进度
                         $item["isImport"] = 1;//导入人才的标志
                         if (count($msg) >= 1) {
@@ -375,7 +375,7 @@ class Import {
                                     break;
                             }
                         }
-                        $item["checkState"] = \app\common\api\TalentState::REVERIFY_PASS; //复审通过
+                        $item["checkState"] = \app\common\api\TalentState::SCND_SAVE; //保存未提交
                         $item["highProcess"] = 5; //最高进度
                         $item["isImport"] = 2;//导入人才的标志
                         if (count($msg) >= 1) {