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('商品不存在'); }