whitefang 1 год назад
Родитель
Сommit
de60fee78e
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      app/api/logic/ServiceOrderLogic.php

+ 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'];
                 }