shish 5 éve
szülő
commit
d327f602b3
1 módosított fájl, 11 hozzáadás és 3 törlés
  1. 11 3
      biz-ghs/order/services/OrderService.php

+ 11 - 3
biz-ghs/order/services/OrderService.php

@@ -246,7 +246,6 @@ class OrderService extends BaseService
     public static function checkBeforePay($order, $userId)
     public static function checkBeforePay($order, $userId)
     {
     {
         $now = time();
         $now = time();
-        OrderClass::setExpire($order);
         if (empty($order)) {
         if (empty($order)) {
             util::fail('订单无效');
             util::fail('订单无效');
         }
         }
@@ -256,7 +255,10 @@ class OrderService extends BaseService
         if ($order['status'] != 0) {
         if ($order['status'] != 0) {
             util::fail('订单不是待付款状态');
             util::fail('订单不是待付款状态');
         }
         }
-        if (!empty($order['deadline']) && $now > $order['deadline']) {
+        if (isset($order['deadline']) && $now > $order['deadline']) {
+            $id = $order['id'];
+            $info = OrderClass::getLockById($id);
+            self::expire($info);
             util::fail('订单已过期');
             util::fail('订单已过期');
         }
         }
         if (ceil($order['actPrice']) <= 0) {
         if (ceil($order['actPrice']) <= 0) {
@@ -270,13 +272,19 @@ class OrderService extends BaseService
     //商家验证是否有效 ssh 2019.12.15
     //商家验证是否有效 ssh 2019.12.15
     public static function valid($order, $shopId)
     public static function valid($order, $shopId)
     {
     {
-        OrderClass::setExpire($order);
+        $now = time();
         if (empty($order)) {
         if (empty($order)) {
             util::fail('订单无效');
             util::fail('订单无效');
         }
         }
         if ($order['shopId'] != $shopId) {
         if ($order['shopId'] != $shopId) {
             util::fail('不是您的订单');
             util::fail('不是您的订单');
         }
         }
+        if (isset($order['deadline']) && $now > $order['deadline']) {
+            $id = $order['id'];
+            $info = OrderClass::getLockById($id);
+            self::expire($info);
+            util::fail('订单已过期');
+        }
     }
     }
 
 
     //点评 ssh 2019.12.16
     //点评 ssh 2019.12.16