|
|
@@ -601,6 +601,15 @@ class OrderController extends BaseController
|
|
|
//阿东开5支老是会出现5扎情况跟踪
|
|
|
ProductClass::adStockCheck($this->shop, $productList);
|
|
|
|
|
|
+ //3秒内不允许重复开单
|
|
|
+ $staffId = $this->shopAdminId ?? 0;
|
|
|
+ $cacheKey = 'hd_create_order_' . $staffId . '_' . $customId;
|
|
|
+ $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
|
|
|
+ if (!empty($has)) {
|
|
|
+ util::fail('请稍等');
|
|
|
+ }
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 3, 'has']);
|
|
|
+
|
|
|
$return = OrderService::createFinishOrder($post, $custom, $hasPay);
|
|
|
$transaction->commit();
|
|
|
|