diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index 39987d21..ac45ff70 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -1098,7 +1098,7 @@ class ProductRepository extends BaseRepository * @param $id * @param $userInfo */ - public function detail(int $id, $userInfo) + public function detail(int $id, $userInfo,$product_type) { $where = [ 'is_show' => 1, @@ -1107,7 +1107,7 @@ class ProductRepository extends BaseRepository 'mer_status' => 1, 'product_id' => $id ]; - return $this->apiProductDetail($where, 0, null, $userInfo); + return $this->apiProductDetail($where, $product_type, null, $userInfo); } @@ -1150,6 +1150,7 @@ class ProductRepository extends BaseRepository if (!$res) return []; switch ($res['product_type']) { case 0: + case 98: $append[] = 'max_integral'; $append[] = 'show_svip_info'; break; @@ -1240,7 +1241,6 @@ class ProductRepository extends BaseRepository $active = app()->make(StoreActivityRepository::class)->getActivityBySpu(StoreActivityRepository::ACTIVITY_TYPE_ATMOSPHERE,$res['spu_id'],$res['cate_id'],$res['mer_id']); if ($active) $res['atmosphere_pic'] = $active['pic']; } - return $res; } diff --git a/app/controller/api/store/product/StoreProduct.php b/app/controller/api/store/product/StoreProduct.php index b63ecf94..0332a23d 100644 --- a/app/controller/api/store/product/StoreProduct.php +++ b/app/controller/api/store/product/StoreProduct.php @@ -64,7 +64,8 @@ class StoreProduct extends BaseController */ public function detail($id) { - $data = $this->repository->detail($id, $this->userInfo); + $param = $this->request->params(['type', ['product_type', 0]]); + $data = $this->repository->detail($id, $this->userInfo,$param['product_type']); if (!$data){ app()->make(SpuRepository::class)->changeStatus($id,0); return app('json')->fail('商品已下架');