Browse Source

购物车脏数据处理

master
Lemon 5 years ago
parent
commit
020e53a607
  1. 6
      app/Service/v3/Implementations/ShopCartUpdateService.php

6
app/Service/v3/Implementations/ShopCartUpdateService.php

@ -34,11 +34,17 @@ class ShopCartUpdateService implements ShopCartUpdateServiceInterface
$builder = GoodsActivity::query();
$goodsType = GoodsActivity::class;
$goods = $builder->find($goodsId);
if(empty($goods)){
throw new ErrorCodeException(ErrorCode::GOODS_NOT_EXISTS);
}
$goodsCheck = $this->goodsActivityService->check($goods,$num,$userId);
}else{
$builder = Goods::query();
$goodsType = Goods::class;
$goods = $builder->find($goodsId);
if(empty($goods)){
throw new ErrorCodeException(ErrorCode::GOODS_NOT_EXISTS);
}
$goodsCheck = $this->goodsService->check($goods,$num);
}
if(empty($goods)){

Loading…
Cancel
Save