From 08cb158983ecb506cdad317436b28b9f89629132 Mon Sep 17 00:00:00 2001 From: xucong <850806214@qq.com> Date: Tue, 13 Aug 2024 09:28:28 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=8E=B7=E5=8F=96=E8=B7=9D=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/LocalStore.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/api/controller/LocalStore.php b/app/api/controller/LocalStore.php index 5855a572..235674b3 100755 --- a/app/api/controller/LocalStore.php +++ b/app/api/controller/LocalStore.php @@ -215,10 +215,17 @@ class LocalStore extends Api public function getLocalShopById() { $id = $this->request->post('id'); - $latitude = $this->request->post('latitude'); - $longitude = $this->request->post('longitude'); + $latitude = $this->request->post('latitude',0); + $longitude = $this->request->post('longitude',0); + $user_id = $this->user_id; + $u = ""; + if($latitude == 0){ + $u = "user_id = $user_id"; + } + $result = Db::name('local_store') - ->where(['lstore_id' => $id, 'user_id' => $this->user_id, 'store_state' => 1]) + ->where(['lstore_id' => $id,'store_state' => 1]) + ->where($u) ->order('create_time', 'desc') ->field('latitude,longitude,lstore_id, store_state, header_image, store_nickname, pay_image,shopName,shopLogo') ->find();