增加处理无门槛优惠卷金额问题
This commit is contained in:
parent
03784663ba
commit
5d61a9113c
@ -162,8 +162,8 @@ class UserCouponService extends BaseService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理满减金额优惠卷
|
// 处理满减金额/无门槛优惠卷
|
||||||
if ($coupon['coupon_type'] == 2){
|
if ($coupon['coupon_type'] == 2 || $coupon['coupon_type'] == 1){
|
||||||
// 可共用一个优惠卷的商品金额问题
|
// 可共用一个优惠卷的商品金额问题
|
||||||
$product_price = 0;
|
$product_price = 0;
|
||||||
|
|
||||||
@ -185,9 +185,20 @@ class UserCouponService extends BaseService
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($coupon['with_amount'] > $product_price){
|
// 满减金额优惠卷
|
||||||
// 此优惠卷因商品金额不足,无法使用
|
if ($coupon['coupon_type'] == 2){
|
||||||
$coupons[$key]['is_can_use'] = 0;
|
if ($coupon['with_amount'] > $product_price){
|
||||||
|
// 此优惠卷因商品金额不足,无法使用
|
||||||
|
$coupons[$key]['is_can_use'] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 无门槛优惠卷
|
||||||
|
if ($coupon['coupon_type'] == 1){
|
||||||
|
if ($product_price <= 0){
|
||||||
|
// 商品总金额已经为0,不使用优惠卷
|
||||||
|
$coupons[$key]['is_can_use'] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user