Browse Source

完善报名接口

15954078560 2 năm trước cách đây
mục cha
commit
c3b8e03943
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      application/api/controller/Index.php

+ 4 - 2
application/api/controller/Index.php

@@ -358,7 +358,8 @@ class Index extends Api
                             }
                             if ($user_coupon_info['type'] == 1) {
                                 //打折券
-                                $price = number_format($info['price'] * $user_coupon_info['money'] / 100, 2, '.', '');
+                                $coupon_price = number_format($info['price'] * (100 - $user_coupon_info['money']) / 100, 2, '.', '');
+                                $price = number_format($info['price'] - $coupon_price, 2, '.', '');
                             } else {
                                 //抵扣券
                                 $price = number_format($info['price'] - $user_coupon_info['money'], 2, '.', '');
@@ -374,7 +375,8 @@ class Index extends Api
                         if ($v['coupon_id']) { //使用优惠券
                             if ($user_coupon_info['type'] == 1) {
                                 //打折券
-                                $price = number_format($vipprice * $user_coupon_info['money'] / 100, 2, '.', '');
+                                $coupon_price = number_format($vipprice * (100 - $user_coupon_info['money']) / 100, 2, '.', '');
+                                $price = number_format($vipprice - $coupon_price, 2, '.', '');
                             } else {
                                 //抵扣券
                                 $price = number_format($vipprice - $user_coupon_info['money'], 2, '.', '');