更新接口

This commit is contained in:
mkm 2023-04-23 19:44:44 +08:00
parent 087b01c74a
commit 17b5db0e4e
2 changed files with 5 additions and 4 deletions

View File

@ -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;
}

View File

@ -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('商品已下架');