From 8ebb7ce337a26ed7aa3b5faee3d99296102c7a17 Mon Sep 17 00:00:00 2001 From: xucong <850806214@qq.com> Date: Fri, 17 Apr 2026 21:46:02 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/ShopLogic.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/api/logic/ShopLogic.php b/app/api/logic/ShopLogic.php index 0b74e66b..5e943a30 100644 --- a/app/api/logic/ShopLogic.php +++ b/app/api/logic/ShopLogic.php @@ -169,7 +169,7 @@ class ShopLogic extends Logic ['status', '=', GoodsEnum::STATUS_SHELVES], // 上架中 ['audit_status', '=', GoodsEnum::AUDIT_STATUS_OK], // 审核通过 ]; - $shop['on_sale_count'] = Goods::where($onSaleWhere)->where('shop_id', $shopId)->count(); + $shop['on_sale_count'] = Goods::where($onSaleWhere)->where('shop_id', $shop['id'])->count(); // 店铺推荐商品 $shop['goods_list'] = Goods::field('id,image,name,min_price,market_price') @@ -185,20 +185,20 @@ class ShopLogic extends Logic // 用户是否关注店铺 $shop['shop_follow_status'] = 0; if($userId) { // 用户已登录 - $shopFollow = ShopFollow::where(['user_id'=>$userId, 'shop_id'=>$shopId])->findOrEmpty(); + $shopFollow = ShopFollow::where(['user_id'=>$userId, 'shop_id'=>$shop['id']])->findOrEmpty(); if(!$shopFollow->isEmpty()) { $shop['shop_follow_status'] = $shopFollow['status']; } } - $shop['follow_num'] = ShopFollow::where(['shop_id' => $shopId,'status' => 1])->count('id'); - $image = ConfigServer::get('shop_customer_service', 'image', '', $shopId); + $shop['follow_num'] = ShopFollow::where(['shop_id' => $shop['id'],'status' => 1])->count('id'); + $image = ConfigServer::get('shop_customer_service', 'image', '', $shop['id']); $shop['customer_image'] = $image ? UrlServer::getFileUrl($image) : ''; - $shop['customer_wechat'] = ConfigServer::get('shop_customer_service', 'wechat', '', $shopId); - $shop['customer_phone'] = ConfigServer::get('shop_customer_service', 'phone', '', $shopId); + $shop['customer_wechat'] = ConfigServer::get('shop_customer_service', 'wechat', '', $shop['id']); + $shop['customer_phone'] = ConfigServer::get('shop_customer_service', 'phone', '', $shop['id']); // 店铺广告 $adWhere = [ - [ 'shop_id', '=', $shopId ], + [ 'shop_id', '=', $shop['id'] ], [ 'status', '=', 1 ], ]; $shop['ad'] = [