wesmiler hai 3 días
pai
achega
a44bbd03f3
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      app/Services/Api/GoodsService.php

+ 4 - 4
app/Services/Api/GoodsService.php

@@ -370,8 +370,8 @@ class GoodsService extends BaseService
             // 会员折扣
             $orderTotal = $result['order_total'];
             if($discountPoint>0 && $discountPoint<10){
-                $result['order_total'] = moneyFormat( $result['order_total']*$discountPoint/10,2);
-                $result['discount_total'] = moneyFormat($orderTotal - $result['order_total'],2);
+                $result['order_total'] = floatval(moneyFormat( $result['order_total']*$discountPoint/10,2));
+                $result['discount_total'] = floatval(moneyFormat($orderTotal - $result['order_total'],2));
             }
 
             // 非商品优惠券,整个订单的优惠券
@@ -382,8 +382,8 @@ class GoodsService extends BaseService
                 }
 
                 $couponTotal = isset($couponData['coupon_total'])?$couponData['coupon_total'] : 0;
-                $result['order_total'] = isset($couponData['total'])?$couponData['total'] : 0;
-                $result['coupon_total'] = $couponTotal;
+                $result['order_total'] = floatval(isset($couponData['total'])?$couponData['total'] : 0);
+                $result['coupon_total'] = floatval($couponTotal);
             }
 
             $result['pay_total'] = moneyFormat($result['order_total'] + $result['delivery_fee'],2);