|
@@ -1006,12 +1006,14 @@ class ServicesController extends Curd
|
|
|
$couponUseJson = [];
|
|
|
$discountJson = [];
|
|
|
if (!empty($order->order_discount_json)) {
|
|
|
- $discountJson = json_decode($order->order_discount_json, true);
|
|
|
+ $discountJson = json_decode($order->order_discount_json, true);;
|
|
|
foreach ($discountJson as $item) {
|
|
|
if (isset($item['coupon_value']) && sprintf('%.2f', (floatval($order->order_amount_total) - floatval($params['order_amount_pay']))) != sprintf('%.2f', $item['coupon_value'])) {
|
|
|
throw new BusinessException("计算优惠后,实付金额错误!");
|
|
|
}
|
|
|
}
|
|
|
+ $couponUseJson = $discountJson;
|
|
|
+ $this->changeOrderCouponStatus($couponUseJson, 'USED');
|
|
|
// // 释放下单时选的优惠券
|
|
|
// $order->order_discount_json = $this->releaseCoupon($discountJson);
|
|
|
}
|
|
@@ -1535,6 +1537,8 @@ class ServicesController extends Curd
|
|
|
throw new BusinessException("计算优惠后,实付金额错误!");
|
|
|
}
|
|
|
}
|
|
|
+ $couponUseJson = $discountJson;
|
|
|
+ $this->changeOrderCouponStatus($couponUseJson, 'USED');
|
|
|
// 释放下单时选的优惠券
|
|
|
// $order->order_discount_json = $this->releaseCoupon($discountJson);
|
|
|
}
|