Browse Source

人才库变更兼容旧数据

sugangqiang 1 year ago
parent
commit
3042ac934e

+ 15 - 0
app/admin/controller/TalentBankChange.php

@@ -61,6 +61,21 @@ class TalentBankChange extends AdminController {
             $responseObj->msg = "系统错误,请联系管理员";
             return $responseObj;
         }
+        if (strlen($info["talentId"]) == 19) {
+            //旧系统申请兼容处理
+            unset($where);
+            $where[] = ["enterprise_id", "=", $info["enterpriseId"]];
+            $where[] = ["card_number", "=", $info["idCard"]];
+            $where[] = ["checkState", "=", \app\common\api\TalentState::CERTIFICATED];
+            $where[] = ["active", "=", 1];
+            $where[] = ["delete", "=", 0];
+            $ti = \app\enterprise\model\Talent::where($where)->order("createTime desc")->find();
+            if (!$ti) {
+                $responseObj->msg = "未匹配到人才数据";
+                return $responseObj;
+            }
+            $info["talentId"] = $ti["id"];
+        }
         if (!$checkState) {
             $responseObj->msg = "请选择审核状态";
             return $responseObj;

+ 16 - 0
app/admin/controller/TalentBasicChange.php

@@ -83,6 +83,22 @@ class TalentBasicChange extends AdminController {
             $responseObj->msg = "系统错误,请联系管理员";
             return $responseObj;
         }
+        if (strlen($info["talentId"]) == 19) {
+            //旧系统申请兼容处理
+            unset($where);
+            $where[] = ["enterprise_id", "=", $info["enterpriseId"]];
+            $where[] = ["card_type", "=", $info["oldCardType"]];
+            $where[] = ["card_number", "=", $info["oldIdCard"]];
+            $where[] = ["checkState", "=", \app\common\api\TalentState::CERTIFICATED];
+            $where[] = ["active", "=", 1];
+            $where[] = ["delete", "=", 0];
+            $ti = \app\enterprise\model\Talent::where($where)->order("createTime desc")->find();
+            if (!$ti) {
+                $responseObj->msg = "未匹配到人才数据";
+                return $responseObj;
+            }
+            $info["talentId"] = $ti["id"];
+        }
         if (!$checkState) {
             $responseObj->msg = "请选择审核状态";
             return $responseObj;

+ 1 - 0
app/admin/controller/TalentQuit.php

@@ -66,6 +66,7 @@ class TalentQuit extends AdminController {
         if (strlen($info["talentId"]) == 19) {
             //旧系统申请兼容处理
             unset($where);
+            $where[] = ["enterprise_id", "=", $info["enterpriseId"]];
             $where[] = ["card_number", "=", $info["idCard"]];
             $where[] = ["checkState", "=", \app\common\api\TalentState::CERTIFICATED];
             $where[] = ["active", "=", 1];