From 6ddac080567b041cb6265c270941681cf00692e3 Mon Sep 17 00:00:00 2001 From: weiz <736250432@qq.com> Date: Tue, 21 May 2024 16:06:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86\=E7=BB=8F=E9=94=80?= =?UTF-8?q?=E5=95=86=E5=85=A5=E9=A9=BB=E5=9C=B0=E5=9D=80=E7=9C=81=E5=B8=82?= =?UTF-8?q?=E5=8C=BA=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/shop/IndexController.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/api/controller/shop/IndexController.php b/app/api/controller/shop/IndexController.php index 9785c36..fb50fb3 100644 --- a/app/api/controller/shop/IndexController.php +++ b/app/api/controller/shop/IndexController.php @@ -45,6 +45,17 @@ class IndexController extends BaseApiController{ $shop_user_id= $this->get_x_token(); $post['shop_user_id']=$shop_user_id; $find=Db::name('user_auth_shop')->where('shop_uid',$post['shop_user_id'])->find(); + $city = Db::name('geo_city')->field('province_code,city_code')->where('city_name', 'like', '%' . $post['city_name'] . '%')->find(); + if(empty($city)){ + $post['province_id'] = ''; + $post['city_id'] = ''; + $post['area_id'] = ''; + }else{ + $post['province_id'] = $city['province_code']; + $post['city_id'] = $city['city_code']; + $area = Db::name('geo_area')->field('area_code')->where('city_code', $city['city_code'])->where('area_name', 'like', '%' . $post['area_name'] . '%')->find(); + $post['area_id'] = !empty($area) ? $area['area_code'] : ''; + } if($post['is_merchant_type']==1){ if($find){ $res=MerchantLogic::edit($post);