|
|
|
@ -47,6 +47,12 @@ class GoodsController extends BaseController |
|
|
|
$res['detail'] = $this->goodsService->detail($params['goods_id']); |
|
|
|
$res['banner'] = $this->goodsService->getBanner(1572); |
|
|
|
} |
|
|
|
|
|
|
|
//如果没有banner数据,使用商品cover图
|
|
|
|
if(count($res['banner']) == 0){ |
|
|
|
$res['banner'] = [$res['detail']['cover_img']]; |
|
|
|
} |
|
|
|
|
|
|
|
if(isset($params['user_id'])) { |
|
|
|
$res['shopcart']['count'] = $this->shopCartService->check(111); |
|
|
|
$res['shopcart']['total'] = $this->shopCartService->getTotal(); |
|
|
|
|