1
0
whitefang 2 жил өмнө
parent
commit
de60fee78e

+ 4 - 1
app/api/logic/ServiceOrderLogic.php

@@ -79,7 +79,10 @@ class ServiceOrderLogic extends BaseLogic
                 //优惠券折扣
                 if($user_coupon['mold_type'] == 1){
                     //按比例折扣
-                    $order_coupon_amount = range($order_amount*(1-$user_coupon['discount_ratio']),2);
+                    if($user_coupon['discount_ratio']>=1){
+                        throw new Exception('优惠券有误,请联系客服');
+                    }
+                    $order_coupon_amount = ceil($order_amount*(1-$user_coupon['discount_ratio']));
                 }else{
                     $order_coupon_amount = $user_coupon['amount'];
                 }