|
|
@@ -183,6 +183,7 @@ class OrderService extends BaseService
|
|
|
$addressId = isset($params['address_id']) && $params['address_id'] ? $params['address_id'] : 0;
|
|
|
$goods = isset($params['goods']) && $params['goods'] ? $params['goods'] : [];
|
|
|
$ids = $goods ? array_column($goods, 'id') : [];
|
|
|
+ $skuIds = $goods ? array_column($goods, 'sku_id') : [];
|
|
|
// 参数验证
|
|
|
if (empty($goods) || empty($ids)) {
|
|
|
$this->error = '商品参数不为空';
|
|
|
@@ -334,7 +335,7 @@ class OrderService extends BaseService
|
|
|
|
|
|
// 清空购物车结算商品
|
|
|
if($submitType == 'cart'){
|
|
|
- CartModel::whereIn('goods_id',$ids)->where(['user_id'=>$userId,'mark'=>1])->update(['mark'=>0,'num'=>0,'update_time'=>time()]);
|
|
|
+ CartModel::whereIn('goods_id',$ids)->whereIn('sku_id',$skuIds)->where(['user_id'=>$userId,'mark'=>1])->update(['mark'=>0,'num'=>0,'update_time'=>time()]);
|
|
|
RedisService::clear("caches:goods:cartCount:{$userId}");
|
|
|
}
|
|
|
|