更新接口
This commit is contained in:
parent
087b01c74a
commit
17b5db0e4e
@ -1098,7 +1098,7 @@ class ProductRepository extends BaseRepository
|
|||||||
* @param $id
|
* @param $id
|
||||||
* @param $userInfo
|
* @param $userInfo
|
||||||
*/
|
*/
|
||||||
public function detail(int $id, $userInfo)
|
public function detail(int $id, $userInfo,$product_type)
|
||||||
{
|
{
|
||||||
$where = [
|
$where = [
|
||||||
'is_show' => 1,
|
'is_show' => 1,
|
||||||
@ -1107,7 +1107,7 @@ class ProductRepository extends BaseRepository
|
|||||||
'mer_status' => 1,
|
'mer_status' => 1,
|
||||||
'product_id' => $id
|
'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 [];
|
if (!$res) return [];
|
||||||
switch ($res['product_type']) {
|
switch ($res['product_type']) {
|
||||||
case 0:
|
case 0:
|
||||||
|
case 98:
|
||||||
$append[] = 'max_integral';
|
$append[] = 'max_integral';
|
||||||
$append[] = 'show_svip_info';
|
$append[] = 'show_svip_info';
|
||||||
break;
|
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']);
|
$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'];
|
if ($active) $res['atmosphere_pic'] = $active['pic'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,8 @@ class StoreProduct extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function detail($id)
|
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){
|
if (!$data){
|
||||||
app()->make(SpuRepository::class)->changeStatus($id,0);
|
app()->make(SpuRepository::class)->changeStatus($id,0);
|
||||||
return app('json')->fail('商品已下架');
|
return app('json')->fail('商品已下架');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user