From e3af8c132e7be46d9ed12a716f41561e8f1bb011 Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Tue, 22 Oct 2024 09:47:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=BE=E7=89=87=E7=9A=84?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/LocalStoreLogic.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/api/logic/LocalStoreLogic.php b/app/api/logic/LocalStoreLogic.php index 7de48b0e..19dc349b 100644 --- a/app/api/logic/LocalStoreLogic.php +++ b/app/api/logic/LocalStoreLogic.php @@ -167,7 +167,7 @@ class LocalStoreLogic extends Logic $pic = LocalStoreGoodsPic::where('lsg_id', $value['id'])->field('url')->find(); $lists[$key]['url'] = $pic['url']; - if ($value['distance'] <= 0) { + if ($value['distance'] <= 0.5) { $lists[$key]['distance'] = '<500m'; } else { $lists[$key]['distance'] = number_format($value['distance'], 2, '.', '') . "km"; @@ -230,7 +230,7 @@ class LocalStoreLogic extends Logic ->where(['ls.is_delete' => 0, 'ls.store_state' => 1]) ->where($where) ->whereNotNull('ls.shopLogo') - ->field('ls.lstore_id as ls_id, ls.shopLogo, ls.shopName, ls.longitude, ls.latitude, ' . $distance_sql . ', lsg.lstore_id') + ->field('ls.lstore_id as ls_id, ls.shopLogo, ls.shopName, ls.longitude, ls.latitude, ls.latitude, ls.address, ' . $distance_sql . ', lsg.lstore_id') ->order($order) ->page($data['page_no'], $data['page_size']) ->group('ls.lstore_id') @@ -243,14 +243,15 @@ class LocalStoreLogic extends Logic $lists[$key]['price'] = round($value['price'] * LocalStoreGoodsLogic::$sale, 2); } + // 店铺下面的商品数量 $lists[$key]['goods_count'] = LocalStoreGoods::where(['lstore_id' => $value['ls_id'], 'state' => 1, 'audit_status' => 1, 'delete_time' => 0])->count(); - if ($value['distance'] <= 0) { + // 店铺距离 + if ($value['distance'] <= 0.5) { $lists[$key]['distance'] = '<500m'; } else { $lists[$key]['distance'] = number_format($value['distance'], 2, '.', '') . "km"; } - $lists[$key]['store_nickname'] = $value["shopName"]; } $data = [