Browse Source

更新价格精度

lang 3 years ago
parent
commit
8a02a8b3af
1 changed files with 4 additions and 3 deletions
  1. 4 3
      Controller/CloudStorage.py

+ 4 - 3
Controller/CloudStorage.py

@@ -1190,9 +1190,10 @@ class CloudStorageView(View):
                 price = coupon_discount/10 * price
                 price = coupon_discount/10 * price
             elif couponQuery[0]['type'] == 2:  #抵扣
             elif couponQuery[0]['type'] == 2:  #抵扣
                 price = price - coupon_discount
                 price = price - coupon_discount
-            if price < 0 or price == 0:
-                price = 0.01
-        price = round(float(price), 2)
+        price = float(price)
+        if price < 0 or price == 0 or price < 0.01:
+            price = 0.01
+        price = round(price, 2)
         if pay_type == 1:
         if pay_type == 1:
             # 订阅周期扣款
             # 订阅周期扣款
             if(smqs[0]['cycle_config_id']):
             if(smqs[0]['cycle_config_id']):