|
|
|
@ -158,6 +158,7 @@ class OrderOnlineService implements OrderOnlineServiceInterface |
|
|
|
$dataChildren = []; # 子订单
|
|
|
|
$dataOrderGoods = []; # 订单商品
|
|
|
|
$storeTypeIds = []; # 订单中的商户类型,用于校验红包
|
|
|
|
$activityGoodsIds = []; # 活动商品IDs
|
|
|
|
|
|
|
|
foreach ($storeList as $key => &$storeItem) { |
|
|
|
|
|
|
|
@ -214,6 +215,10 @@ class OrderOnlineService implements OrderOnlineServiceInterface |
|
|
|
} |
|
|
|
$isCacheInventory = true; |
|
|
|
|
|
|
|
if ($cart->activity_type == 2) { |
|
|
|
$activityGoodsIds[] = $cart->goods_id; |
|
|
|
} |
|
|
|
|
|
|
|
// 算金额
|
|
|
|
$goodsAmount = bcmul((string)$goods->price, (string)$cart->num); # 当前商品的金额
|
|
|
|
$subAmount = bcadd((string)$subAmount, (string)$goodsAmount); # 当前店铺子订单的金额
|
|
|
|
@ -330,7 +335,7 @@ class OrderOnlineService implements OrderOnlineServiceInterface |
|
|
|
} |
|
|
|
|
|
|
|
// 判断是否有购买多个特价商品
|
|
|
|
$check = $this->goodsActivityService->checkOrderActivityCount($dataOrderGoods); |
|
|
|
$check = $this->goodsActivityService->checkOrderActivityCount($activityGoodsIds); |
|
|
|
if(!$check){ |
|
|
|
$this->log->event(LogLabel::ORDER_ONLINE_LOG, ['msg' => '订单中有活动商品超过限购数量', 'data' => json_encode($dataOrderGoods)]); |
|
|
|
throw new ErrorCodeException(ErrorCode::GOODS_ACTIVITY_RESTRICT_LIMIT); |
|
|
|
|