修改商品详情查询
This commit is contained in:
parent
9e4e2be024
commit
dd1033aee9
@ -288,7 +288,11 @@ class StoreProductLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
public static function detail($params): array
|
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)){
|
if(empty($data)){
|
||||||
throw new BusinessException('商品不存在');
|
throw new BusinessException('商品不存在');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user