浏览代码

使用优惠券后价格等于或者小于0的,价格为0.01

lang 3 年之前
父节点
当前提交
3b986e0dfb
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      Controller/CloudStorage.py

+ 3 - 4
Controller/CloudStorage.py

@@ -1181,13 +1181,12 @@ class CloudStorageView(View):
                 return response.json(10049)
             price = Decimal(price)
             coupon_discount = Decimal(couponQuery[0]['coupon_discount'])
-            if couponQuery[0]['type'] == 1:  #折
+            if couponQuery[0]['type'] == 1:  #
                 price = coupon_discount/10 * price
             elif couponQuery[0]['type'] == 2:  #抵扣
                 price = price - coupon_discount
-            if price < 0:
-                return response.json(10049)
-
+            if price < 0 or price == 0:
+                price = 0.01
         price = round(float(price), 2)
         if pay_type == 1:
             # 订阅周期扣款