瀏覽代碼

修改verifyapi中关于类型描述的获取方式

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

+ 6 - 5
app/common/api/VerifyApi.php

@@ -8,6 +8,7 @@ use app\common\api\DictApi;
 use app\admin\model\Enterprise;
 use think\facade\Db;
 use app\common\model\TalentCondition;
+use app\common\state\CommonConst;
 
 /**
  * Description of VerifyApi
@@ -74,7 +75,7 @@ class VerifyApi {
             $info["medicalCommunityName"] = $enterprise["medicalCommunityId"] ? \app\common\api\Nhc::getMedicalCommunityMap()[$enterprise["medicalCommunityId"]] : "";
 
             if ($info["talent_type"]) {
-                if ($enterprise["type"] == \app\common\state\CommonConst::ENTERPRISE_WJ) {
+                if ($enterprise["type"] == CommonConst::ENTERPRISE_WJ) {
                     $info["talentTypeName"] = $info["talent_type"] ? DictApi::selectByParentCode("wj_talent_type")[$info["talent_type"]] : "";
                 } else {
                     $info["talentTypeName"] = $info["talent_type"] ? DictApi::selectByParentCode("talent_type")[$info["talent_type"]] : "";
@@ -276,7 +277,7 @@ class VerifyApi {
                         ->limit($offset, $limit)->order("ti.createTime " . $order)
                         ->select()->toArray();
         foreach ($list as &$item) {
-            $item["talent_type"] = $item["enterprise_type"] == 1 ? "晋江市现代产业体系人才" : "集成电路优秀人才";
+            $item["talent_type"] = CommonConst::getTypeName($item["enterprise_type"]);
             $item["enterprise_tag"] = $enterprise_tag_kvs[$item["enterpriseTag"]];
             $item["talentArrangeName"] = $talent_arrange_kvs[$item["talent_arrange"]];
             $companys = array_filter(explode(",", $item["companyIds"]));
@@ -353,7 +354,7 @@ class VerifyApi {
                         ->select()->toArray();
         $medicalCommunity_kvs = Nhc::getMedicalCommunityMap();
         foreach ($list as &$item) {
-            $item["talent_type"] = $item["enterprise_type"] == 1 ? "晋江市现代产业体系人才" : "集成电路优秀人才";
+            $item["talent_type"] = CommonConst::getTypeName($item["enterprise_type"]);
             $item["enterprise_tag"] = $enterprise_tag_kvs[$item["enterpriseTag"]];
             $lastCheckLog = TalentLogApi::getCompanyNewestCheckedLog($item["id"], $companyId);
             $item["deptCheckState"] = $lastCheckLog["new_state"] ?: TalentState::FST_VERIFY_PASS;
@@ -407,7 +408,7 @@ class VerifyApi {
                         ->order("ti.createTime " . $order)
                         ->field("ti.*,e.name as enterpriseName,e.type as enterprise_type,enterpriseTag")->select()->toArray();
         foreach ($list as &$item) {
-            $item["talent_type"] = $item["enterprise_type"] == 1 ? "晋江市现代产业体系人才" : "集成电路优秀人才";
+            $item["talent_type"] = CommonConst::getTypeName($item["enterprise_type"]);
             $item["enterprise_tag"] = $enterprise_tag_kvs[$item["enterpriseTag"]];
         }unset($item);
         return $list;
@@ -653,7 +654,7 @@ class VerifyApi {
         $enterprise_tag_kvs = DictApi::selectByParentCode("enterprise_tag");
         $medicalCommunity_kvs = Nhc::getMedicalCommunityMap();
         foreach ($list as &$item) {
-            $item["talent_type"] = $item["enterprise_type"] == 1 ? "晋江市现代产业体系人才" : "集成电路优秀人才";
+            $item["talent_type"] = CommonConst::getTypeName($item["enterprise_type"]);
             $item["enterprise_tag"] = $enterprise_tag_kvs[$item["enterpriseTag"]];
             $item["talentArrangeName"] = $talent_arrange_kvs[$item["talent_arrange"]];
             $item["talentConditionName"] = TalentCondition::findOrEmpty($item["talent_condition"])["name"];