Browse Source

下单页面折扣优惠券精度

master
Lemon 5 years ago
parent
commit
b9b2f5c11d
  1. 9
      app/Service/v3/Implementations/OrderOnlineService.php

9
app/Service/v3/Implementations/OrderOnlineService.php

@ -350,9 +350,12 @@ class OrderOnlineService implements OrderOnlineServiceInterface
$couponMoney = bcadd($couponMoney, $coupon->coupon->discounts, 2);
} elseif ($coupon->coupon->discount_type == Coupon::DISCOUNT_TYPE_RATE) {
$discountRate = bcdiv($coupon->coupon->discounts,10);
$discountRate = bcsub(1,$discountRate);
$discountMoney = bcmul($orderAmount, $discountRate);
$couponMoney = bcadd($couponMoney, $discountMoney, 2);
$discountMoney = bcmul($orderAmount, $discountRate, 2);
$couponMoney = bcsub($orderAmount, $discountMoney, 2);
// $discountRate = bcdiv($coupon->coupon->discounts,10);
// $discountRate = bcsub(1,$discountRate);
// $discountMoney = bcmul($orderAmount, $discountRate);
// $couponMoney = bcadd($couponMoney, $discountMoney, 2);
}
}

Loading…
Cancel
Save