diff --git a/app/Controller/v3/GoodsController.php b/app/Controller/v3/GoodsController.php index b6298fe..dd8bdf2 100644 --- a/app/Controller/v3/GoodsController.php +++ b/app/Controller/v3/GoodsController.php @@ -42,10 +42,10 @@ class GoodsController extends BaseController //判断是普通商品还是特价商品 if(isset($params['activity']) && $params['activity'] == Goods::IS_ACTIVITY){ $res['detail'] = $this->goodsActivityService->detail($params['goods_id']); - $res['banner'] = $this->goodsActivityService->getBanner(); + $res['banner'] = $this->goodsActivityService->getBanner(1572); }else{ $res['detail'] = $this->goodsService->detail($params['goods_id']); - $res['banner'] = $this->goodsService->getBanner(); + $res['banner'] = $this->goodsService->getBanner(1572); } if(isset($params['user_id'])) { $res['shopcart']['count'] = $this->shopCartService->check(111); diff --git a/app/Service/v3/Implementations/GoodsActivityService.php b/app/Service/v3/Implementations/GoodsActivityService.php index 9af1d6e..306c98a 100644 --- a/app/Service/v3/Implementations/GoodsActivityService.php +++ b/app/Service/v3/Implementations/GoodsActivityService.php @@ -44,9 +44,9 @@ class GoodsActivityService implements GoodsActivityServiceInterface // TODO: Implement undo() method. } - public function getBanner() + public function getBanner($goodsId) { - $banner = GoodsActivityBanner::query()->where('goods_id',1572)->orderByDesc('type')->get(); + $banner = GoodsActivityBanner::query()->where('goods_id',$goodsId)->orderByDesc('type')->get(); return $banner; } diff --git a/app/Service/v3/Implementations/GoodsService.php b/app/Service/v3/Implementations/GoodsService.php index ad36b59..455e678 100644 --- a/app/Service/v3/Implementations/GoodsService.php +++ b/app/Service/v3/Implementations/GoodsService.php @@ -39,9 +39,9 @@ class GoodsService implements GoodsServiceInterface // TODO: Implement undo() method. } - public function getBanner() + public function getBanner($goodsId) { - $banner = GoodsBanner::query()->where('goods_id',1572)->orderByDesc('type')->get(); + $banner = GoodsBanner::query()->where('goods_id',$goodsId)->orderByDesc('type')->get(); return $banner; } diff --git a/app/Service/v3/Interfaces/GoodsActivityServiceInterface.php b/app/Service/v3/Interfaces/GoodsActivityServiceInterface.php index 7084c83..6fb627c 100644 --- a/app/Service/v3/Interfaces/GoodsActivityServiceInterface.php +++ b/app/Service/v3/Interfaces/GoodsActivityServiceInterface.php @@ -7,6 +7,6 @@ interface GoodsActivityServiceInterface public function do($goodsId); public function check($goodsId,$num = 1); public function undo(); - public function getBanner(); + public function getBanner($goodsId); public function detail($goodsId); } \ No newline at end of file diff --git a/app/Service/v3/Interfaces/GoodsServiceInterface.php b/app/Service/v3/Interfaces/GoodsServiceInterface.php index 5c36a96..bafe7c2 100644 --- a/app/Service/v3/Interfaces/GoodsServiceInterface.php +++ b/app/Service/v3/Interfaces/GoodsServiceInterface.php @@ -7,5 +7,5 @@ interface GoodsServiceInterface public function do($goodsId); public function check($goodsId,$num = 1); public function undo(); - public function getBanner(); + public function getBanner($goodsId); } \ No newline at end of file