|
|
@@ -149,6 +149,12 @@ class OrderController extends BaseController
|
|
|
$orderSn = isset($post['orderSn']) ? $post['orderSn'] : 0;
|
|
|
$payPassword = isset($post['payPassword']) ? $post['payPassword'] : 0;
|
|
|
$couponId = isset($post['couponId']) ? $post['couponId'] : 0;
|
|
|
+
|
|
|
+ //验证优惠券是否还有效
|
|
|
+ if (!empty($couponId)) {
|
|
|
+ CouponService::checkBeforeUse($couponId, $order['prePrice'], $order['userId']);
|
|
|
+ }
|
|
|
+
|
|
|
$order = OrderService::getByOrderSn($orderSn);
|
|
|
$userId = $this->userId;
|
|
|
$user = UserService::getUserInfo($userId, false);
|
|
|
@@ -180,9 +186,9 @@ class OrderController extends BaseController
|
|
|
|
|
|
//验证优惠券是否还有效
|
|
|
if (!empty($couponId)) {
|
|
|
- CouponService::valid($couponId, $order['prePrice'], $order['userId']);
|
|
|
+ CouponService::checkBeforeUse($couponId, $order['prePrice'], $order['userId']);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//支付前验证订单有效性
|
|
|
OrderService::checkBeforePay($order, $this->userId);
|
|
|
|