From dd1033aee9fef8dc3686b831ad40c0fa0261012f Mon Sep 17 00:00:00 2001 From: "DESKTOP-GMUNQ1B\\Administrator" <604446095@qq.com> Date: Mon, 9 Dec 2024 11:40:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/store_product/StoreProductLogic.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/admin/logic/store_product/StoreProductLogic.php b/app/admin/logic/store_product/StoreProductLogic.php index 06eb1d96b..8fa601ab1 100644 --- a/app/admin/logic/store_product/StoreProductLogic.php +++ b/app/admin/logic/store_product/StoreProductLogic.php @@ -288,7 +288,11 @@ class StoreProductLogic extends BaseLogic */ public static function detail($params): array { - $data = StoreProduct::where('id', $params['id'])->findOrEmpty()->toArray(); + $query = StoreProduct::where('id', $params['id']); + if (isset($params['is_show'])) { + $query->where('is_show', $params['is_show']); + } + $data = $query->findOrEmpty()->toArray(); if(empty($data)){ throw new BusinessException('商品不存在'); }