Explorar o código

避免重复提交

shish hai 1 ano
pai
achega
ed9728dc59

+ 3 - 0
app-hd/controllers/PurchaseClearController.php

@@ -276,6 +276,9 @@ class PurchaseClearController extends BaseController
         }
         $totalFee = $order->actPrice;
 
+        //避免重复提交
+        util::checkRepeatCommit($orderSn, 8);
+
         $capitalType = dict::getDict('capitalType', 'hdPurchaseClear', 'id');
         $ghsShopId = $order->ghsShopId ?? 0;
         $ghsShop = ShopClass::getById($ghsShopId, true);

+ 6 - 0
app-hd/controllers/PurchaseController.php

@@ -956,6 +956,9 @@ class PurchaseController extends BaseController
             util::fail('商家支付功能未开通');
         }
 
+        //避免重复提交
+        util::checkRepeatCommit($orderSn, 8);
+
         //已经唤起过支付了,根据拉卡拉的规则,需要生成新的订单号
         if ($order->changePrice == 2) {
             $oldOrderSn = $orderSn;
@@ -1068,6 +1071,9 @@ class PurchaseController extends BaseController
             util::fail('订单已失效,请重新下单');
         }
 
+        //避免重复提交
+        util::checkRepeatCommit($orderSn, 8);
+
         $ghsId = $order->ghsId ?? 0;
         $ghs = GhsClass::getById($ghsId, true);
         if (empty($ghs)) {