|
@@ -1174,7 +1174,6 @@ class CloudStorageView(View):
|
|
|
return response.json(10041)
|
|
|
|
|
|
orderID = CommonService.createOrderID()
|
|
|
-
|
|
|
#优惠券
|
|
|
if coupon_id:
|
|
|
couponObj = CouponModel.objects.filter(id=coupon_id, use_status=0, distributeTime__lte=nowTime,
|
|
@@ -1182,12 +1181,13 @@ class CloudStorageView(View):
|
|
|
couponQuery = couponObj.values("id", "type", "coupon_discount")
|
|
|
if not couponQuery.exists():
|
|
|
return response.json(10049)
|
|
|
- price = Decimal(price)
|
|
|
- coupon_discount = Decimal(couponQuery[0]['coupon_discount'])
|
|
|
+ # price = Decimal(price)
|
|
|
+ # coupon_discount = Decimal(couponQuery[0]['coupon_discount'])
|
|
|
if couponQuery[0]['type'] == 1: #折扣
|
|
|
- price = coupon_discount/10 * price
|
|
|
+ price = float(couponQuery[0]['coupon_discount'])/10 * float(price)
|
|
|
elif couponQuery[0]['type'] == 2: #抵扣
|
|
|
- price = price - couponQuery[0]['coupon_discount']
|
|
|
+ price = float(price) - float(couponQuery[0]['coupon_discount'])
|
|
|
+
|
|
|
if price < 0:
|
|
|
return response.json(10049)
|
|
|
couponObj.update(use_status=1)
|