修改商品详情查询

This commit is contained in:
DESKTOP-GMUNQ1B\Administrator 2024-12-09 11:40:57 +08:00
parent 9e4e2be024
commit dd1033aee9

View File

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