|
|
|
@ -44,6 +44,15 @@ class ShopCartUpdateService implements ShopCartUpdateServiceInterface |
|
|
|
if(empty($goods)){ |
|
|
|
throw new ErrorCodeException(ErrorCode::GOODS_NOT_EXISTS); |
|
|
|
} |
|
|
|
//特价商品限购
|
|
|
|
$goodsArr = ShoppingCart::query() |
|
|
|
->where(['user_id' => $userId,'market_id' => $goods->market_id,'activity_type' => GoodsConstants::IS_ACTIVITY]) |
|
|
|
->pluck('goods_id')->toArray(); |
|
|
|
array_push($goodsArr,$goodsId); |
|
|
|
$checkGoodsActivity = $this->goodsActivityService->checkOrderActivityCount($goodsArr); |
|
|
|
if(!$checkGoodsActivity){ |
|
|
|
throw new ErrorCodeException(ErrorCode::GOODS_ACTIVITY_BUY); |
|
|
|
} |
|
|
|
$goodsCheck = $this->goodsActivityService->check($goods,$num,$userId); |
|
|
|
}else{ |
|
|
|
$builder = Goods::query(); |
|
|
|
|