修正了优惠券金额不可用小数点的问题
This commit is contained in:
parent
920228fe48
commit
5ad82a4864
@ -84,11 +84,11 @@ class UserCouponService extends BaseService
|
|||||||
/**
|
/**
|
||||||
* 获取可用优惠卷总金额
|
* 获取可用优惠卷总金额
|
||||||
* @param array $coupons 优惠卷数据
|
* @param array $coupons 优惠卷数据
|
||||||
* @return int
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getCouponTotalPrice(array $coupons): int
|
public function getCouponTotalPrice(array $coupons): string
|
||||||
{
|
{
|
||||||
$coupon_total_price = 0;
|
$coupon_total_price = "0";
|
||||||
|
|
||||||
foreach ($coupons as $coupon){
|
foreach ($coupons as $coupon){
|
||||||
$coupon_total_price = bcadd($coupon_total_price,$coupon['coupon_price'],2);
|
$coupon_total_price = bcadd($coupon_total_price,$coupon['coupon_price'],2);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user