Browse Source

fix:申请验货员前端传地址ID与后端不一致问题

super-yimizi 1 month ago
parent
commit
1a889f6926
1 changed files with 3 additions and 3 deletions
  1. 3 3
      application/common/model/inspection/InspectionApplication.php

+ 3 - 3
application/common/model/inspection/InspectionApplication.php

@@ -148,7 +148,7 @@ class InspectionApplication extends Model
     public function getProvinceNameAttr($value, $data)
     public function getProvinceNameAttr($value, $data)
     {
     {
         if (!empty($data['province_adcode'])) {
         if (!empty($data['province_adcode'])) {
-            $area = \app\common\model\Area::where('adcode', $data['province_adcode'])->find();
+            $area = \app\common\model\Area::where('id', $data['province_adcode'])->find();
             return $area ? $area['name'] : '';
             return $area ? $area['name'] : '';
         }
         }
         return '';
         return '';
@@ -160,7 +160,7 @@ class InspectionApplication extends Model
     public function getCityNameAttr($value, $data)
     public function getCityNameAttr($value, $data)
     {
     {
         if (!empty($data['city_adcode'])) {
         if (!empty($data['city_adcode'])) {
-            $area = \app\common\model\Area::where('adcode', $data['city_adcode'])->find();
+            $area = \app\common\model\Area::where('id', $data['city_adcode'])->find();
             return $area ? $area['name'] : '';
             return $area ? $area['name'] : '';
         }
         }
         return '';
         return '';
@@ -172,7 +172,7 @@ class InspectionApplication extends Model
     public function getDistrictNameAttr($value, $data)
     public function getDistrictNameAttr($value, $data)
     {
     {
         if (!empty($data['district_adcode'])) {
         if (!empty($data['district_adcode'])) {
-            $area = \app\common\model\Area::where('adcode', $data['district_adcode'])->find();
+            $area = \app\common\model\Area::where('id', $data['district_adcode'])->find();
             return $area ? $area['name'] : '';
             return $area ? $area['name'] : '';
         }
         }
         return '';
         return '';