diff --git a/app/common/repositories/store/order/StoreOrderCreateRepository.php b/app/common/repositories/store/order/StoreOrderCreateRepository.php index c338af9d..2868acdc 100644 --- a/app/common/repositories/store/order/StoreOrderCreateRepository.php +++ b/app/common/repositories/store/order/StoreOrderCreateRepository.php @@ -681,7 +681,9 @@ class StoreOrderCreateRepository extends StoreOrderRepository } else { $couponPrice = min(max(0.01, bcmul($_coupon_price, bcdiv($cart['true_price'], $platformCouponRate['price'], 6), 2)), $cart['true_price']); } - $cartCoupon[] = ['coupon_price' => $couponPrice, 'coupon_user_id' => $platformCouponRate['id'], 'cart_id' => $cart['cart_id']]; + if ($platformCouponRate['type'] == StoreCouponRepository::TYPE_PLATFORM_CARD) { + $cartCoupon[] = ['coupon_price' => $couponPrice, 'coupon_user_id' => $platformCouponRate['id'], 'cart_id' => $cart['cart_id']]; + } $platformCouponRate['coupon_price'] = bcsub($platformCouponRate['coupon_price'], $couponPrice, 2); $cart['true_price'] = bcsub($cart['true_price'], $couponPrice, 2); $cart['platform_coupon_price'] = $couponPrice;