From 863895d3bc1513a745667ca5e4985e216444a469 Mon Sep 17 00:00:00 2001 From: weiz Date: Thu, 30 Nov 2023 11:21:46 +0800 Subject: [PATCH] update --- app/api/controller/LandController.php | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/app/api/controller/LandController.php b/app/api/controller/LandController.php index 05582eea..d3dec36e 100644 --- a/app/api/controller/LandController.php +++ b/app/api/controller/LandController.php @@ -59,7 +59,7 @@ public function add(): Json { //获取参数并验证 - $fields = ['title','area','province_code','city_code','county_code','town_code','village_code','group_code','master_name','master_phone','pic']; + $fields = ['title','area','province_code','city_code','county_code','address','longitude','latitude','master_name','master_phone','pic']; $params = $this->request->post($fields); foreach($fields as $v){ if(!isset($params[$v]) || $params[$v] == ''){ @@ -84,18 +84,6 @@ if($county->isEmpty()){ return $this->fail('区县编码错误'); } - $town = Town::field('town_name')->where('county_code',$params['county_code'])->where('town_code',$params['town_code'])->findOrEmpty(); - if($town->isEmpty()){ - return $this->fail('镇街编码错误'); - } - $village = Village::field('village_name')->where('town_code',$params['town_code'])->where('village_code',$params['village_code'])->findOrEmpty(); - if($village->isEmpty()){ - return $this->fail('乡村编码错误'); - } - $group = Group::field('group_name')->where('id',$params['group_code'])->findOrEmpty(); - if($group->isEmpty()){ - return $this->fail('小组编码错误'); - } //验证土地图片字段是否是json数组 $pic = json_decode($params['pic'],true); if(empty($pic)){ @@ -113,12 +101,9 @@ 'city_name' => $city['city_name'], 'county_code' => $params['county_code'], 'county_name' => $county['county_name'], - 'town_code' => $params['town_code'], - 'town_name' => $town['town_name'], - 'village_code' => $params['village_code'], - 'village_name' => $village['village_name'], - 'group_code' => $params['group_code'], - 'group_name' => $group['group_name'], + 'address' => $params['address'], + 'longitude' => $params['longitude'], + 'latitude' => $params['latitude'], 'master_name' => $params['master_name'], 'master_phone' => $params['master_phone'], 'pic' => $params['pic'], -- 2.40.1