瀏覽代碼

上条补充

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

+ 13 - 13
app/common/api/VerifyApi.php

@@ -74,19 +74,19 @@ class VerifyApi {
 
             if ($info["talent_type"]) {
                 if ($enterprise["type"] == \app\common\state\CommonConst::ENTERPRISE_WJ) {
-                    $info["talentTypeName"] = DictApi::selectByParentCode("wj_talent_type")[$info["talent_type"]];
+                    $info["talentTypeName"] = $info["talent_type"] ? DictApi::selectByParentCode("wj_talent_type")[$info["talent_type"]] : "";
                 } else {
-                    $info["talentTypeName"] = DictApi::selectByParentCode("talent_type")[$info["talent_type"]];
+                    $info["talentTypeName"] = $info["talent_type"] ? DictApi::selectByParentCode("talent_type")[$info["talent_type"]] : "";
                 }
             }
             if ($info["nationality"]) {
-                $info["nationalityName"] = DictApi::selectByParentCode("nationality")[$info["nationality"]];
+                $info["nationalityName"] = $info["nationality"] ? DictApi::selectByParentCode("nationality")[$info["nationality"]] : "";
             }
             if ($info["nation"]) {
-                $info["nationName"] = DictApi::selectByParentCode("nation")[$info["nation"]];
+                $info["nationName"] = $info["nation"] ? DictApi::selectByParentCode("nation")[$info["nation"]] : "";
             }
             if ($info["politics"]) {
-                $info["politicsName"] = DictApi::selectByParentCode("politics")[$info["politics"]];
+                $info["politicsName"] = $info["politics"] ? DictApi::selectByParentCode("politics")[$info["politics"]] : "";
             }
             if ($info["province"]) {
                 $info["provinceName"] = Db::table("un_common_location")->where("code", "=", $info["province"])->findOrEmpty()["name"];
@@ -99,22 +99,22 @@ class VerifyApi {
             }
             if ($enterprise["street"]) {
                 $info["street"] = $enterprise["street"];
-                $info["streetName"] = DictApi::selectByParentCode("street")[$enterprise["street"]];
+                $info["streetName"] = $enterprise["street"] ? DictApi::selectByParentCode("street")[$enterprise["street"]] : "";
             }
             if ($enterprise["industryFieldNew"]) {
-                $info["industryFieldName"] = DictApi::selectByParentCode("industry_field")[$enterprise["industryFieldNew"]];
+                $info["industryFieldName"] = $enterprise["industryFieldNew"] ? DictApi::selectByParentCode("industry_field")[$enterprise["industryFieldNew"]] : "";
             }
             if ($enterprise["enterpriseTag"]) {
-                $info["enterpriseTagName"] = DictApi::selectByParentCode("enterprise_tag")[$enterprise["enterpriseTag"]];
+                $info["enterpriseTagName"] = $enterprise["enterpriseTag"] ? DictApi::selectByParentCode("enterprise_tag")[$enterprise["enterpriseTag"]] : "";
             }
             if ($info["talent_arrange"]) {
-                $info["talentArrangeName"] = DictApi::selectByParentCode("talent_arrange")[$info["talent_arrange"]];
+                $info["talentArrangeName"] = $info["talent_arrange"] ? DictApi::selectByParentCode("talent_arrange")[$info["talent_arrange"]] : "";
             }
             if ($info["import_way"]) {
-                $info["importWayName"] = DictApi::selectByParentCode("import_way")[$info["import_way"]];
+                $info["importWayName"] = $info["import_way"] ? DictApi::selectByParentCode("import_way")[$info["import_way"]] : "";
             }
             if ($info["source"]) {
-                $info["sourceName"] = DictApi::selectByParentCode("source")[$info["source"]];
+                $info["sourceName"] = $info["source"] ? DictApi::selectByParentCode("source")[$info["source"]] : "";
             }
             if ($info["source_city"]) {
                 $info["sourceCityName"] = Db::table("un_common_location")->where("code", "=", $info["source_city"])->findOrEmpty()["name"];
@@ -123,7 +123,7 @@ class VerifyApi {
                 $info["sourceCountyName"] = Db::table("un_common_location")->where("code", "=", $info["source_county"])->findOrEmpty()["name"];
             }
             if ($info["highest_degree"]) {
-                $info["highestDegreeName"] = DictApi::selectByParentCode("highest_degree")[$info["highest_degree"]];
+                $info["highestDegreeName"] = $info["highest_degree"] ? DictApi::selectByParentCode("highest_degree")[$info["highest_degree"]] : "";
             }
             if ($info["labor_contract_rangetime"]) {
                 list($startTime, $endTime) = explode(" - ", $info["labor_contract_rangetime"]);
@@ -190,7 +190,7 @@ class VerifyApi {
                 $talent_condition = \app\common\model\TalentCondition::findOrEmpty($info["talent_condition"]);
                 $info["talentConditionName"] = $talent_condition["name"];
                 $info["talent_arrange_category"] = $talent_condition["talentLevelCat"];
-                $info["talentArrangeCatName"] = DictApi::selectByParentCode("talent_condition_cats")[$talent_condition["talentLevelCat"]];
+                $info["talentArrangeCatName"] = $talent_condition["talentLevelCat"] ? DictApi::selectByParentCode("talent_condition_cats")[$talent_condition["talentLevelCat"]] : "";
             }
         }
         return $info;