shish 2 жил өмнө
parent
commit
32012dcc66

+ 8 - 0
app-ghs/controllers/OrderClearController.php

@@ -130,6 +130,14 @@ class OrderClearController extends BaseController
             util::fail('不能销单...');
         }
 
+        //避免网络延迟,造成重复操作
+        $cacheKey = 'ghs_custom_confirm_clear_' . $id;
+        $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
+        if (!empty($has)) {
+            util::fail('6秒之后再操作');
+        }
+        Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 6, 'has']);
+
         //多个地方需要同步修改clear_order_power
         if (getenv('YII_ENV') == 'production') {
             //小向花卉