调整店铺优惠券使用限制
This commit is contained in:
parent
98e4e895b9
commit
b18e7dd1e1
@ -93,6 +93,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
||||
$_merTake = $merTake;
|
||||
$_merDelivery = $merDelivery;
|
||||
$deliveryStatus = true;
|
||||
$enabledCoupon = !($order_type && $order_type != 2);
|
||||
if ($createOrder && $isTake && !$merTake) {
|
||||
$deliveryStatus = false;
|
||||
}
|
||||
@ -142,6 +143,11 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
||||
if ($presellType == 2)
|
||||
$down_price = bcadd($down_price, bcmul($cart['cart_num'], $cart['productPresellAttr']['down_price'], 2), 2);
|
||||
}
|
||||
$merchantCate = $cart['product']->merCateId;
|
||||
if ($cart['product']['type'] == 1 && !empty($merchantCate) && $merchantCate[0]['mer_cate_id'] == env('PLATFORM_CARD_TYPE_ID') && $enabledPlatformCoupon) {
|
||||
$enabledPlatformCoupon = false;
|
||||
$enabledCoupon = false;
|
||||
}
|
||||
}
|
||||
unset($cart);
|
||||
|
||||
@ -151,7 +157,6 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
||||
if ($deliveryStatus && !$isTake && ($merDelivery || $merTake)) {
|
||||
$isTake = $merDelivery ? 0 : 1;
|
||||
}
|
||||
$enabledCoupon = !($order_type && $order_type != 2);
|
||||
//只有预售和普通商品可以用优惠券
|
||||
if (!$enabledCoupon) $merchantCart['coupon'] = [];
|
||||
$svip_coupon_merge = merchantConfig($merchantCart['mer_id'], 'svip_coupon_merge');
|
||||
@ -326,7 +331,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
||||
|
||||
//过滤不可用店铺优惠券
|
||||
foreach ($merchantCart['coupon'] as &$coupon) {
|
||||
if (!$coupon['coupon']['type']) continue;
|
||||
if (in_array($coupon['coupon']['type'], [0, 2])) continue;
|
||||
|
||||
$coupon['disabled'] = false;
|
||||
$coupon['checked'] = false;
|
||||
@ -361,7 +366,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
||||
//}
|
||||
//计算商品券金额
|
||||
foreach ($merchantCart['coupon'] as &$coupon) {
|
||||
if (!$coupon['coupon']['type']) continue;
|
||||
if (in_array($coupon['coupon']['type'], [0, 2])) continue;
|
||||
if ($coupon['disabled']) continue;
|
||||
|
||||
foreach ($coupon['product'] as $_product) {
|
||||
@ -386,7 +391,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
||||
$_pay_price = $pay_price;
|
||||
//计算店铺券
|
||||
foreach ($merchantCart['coupon'] as &$coupon) {
|
||||
if ($coupon['coupon']['type']) continue;
|
||||
if (!in_array($coupon['coupon']['type'], [0, 2])) continue;
|
||||
$coupon['checked'] = false;
|
||||
$coupon['disabled'] = $pay_price <= 0;
|
||||
if ($use_store_coupon || $pay_price <= 0) continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user