Przeglądaj źródła

倒计时控制

shish 5 lat temu
rodzic
commit
f7427247a3
1 zmienionych plików z 4 dodań i 2 usunięć
  1. 4 2
      app-hd/controllers/PurchaseController.php

+ 4 - 2
app-hd/controllers/PurchaseController.php

@@ -76,8 +76,10 @@ class PurchaseController extends BaseController
             $actPrice = $respond->actPrice ?? '';
             $realPrice = $respond->realPrice ?? '';
             $transaction->commit();
-            //倒计时
+            //可以付款的倒计时,实际少120秒,避免支付回调时订单已经自动过期
             $validTime = dict::getDict('sale_purchase_order_valid');
+            $realTime = $validTime - 120;
+            $count = $realTime > 0 ? $realTime : 100;
 
             $data = [
                 'orderSn' => $orderSn,
@@ -86,7 +88,7 @@ class PurchaseController extends BaseController
                 'hasBalancePay' => 1,
                 'hasPayPassword' => 0,
                 'hasDebtPay' => 1,
-                'count' => $validTime,
+                'count' => $count,
             ];
             util::success($data);
         } catch (Exception $e) {