|
|
@@ -248,12 +248,21 @@ class RefundController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
+ $id = isset($post['id']) ? $post['id'] : 0;
|
|
|
+ $refundType = $post['refundType'] ?? 1;
|
|
|
+
|
|
|
+ //避免网络延迟,暂时重复申请
|
|
|
+ $cacheKey = 'ghs_order_refund_' . $id;
|
|
|
+ $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
|
|
|
+ if (!empty($has)) {
|
|
|
+ util::fail('请10秒之后再提交');
|
|
|
+ }
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 10, 'has']);
|
|
|
+
|
|
|
$connection = Yii::$app->db;
|
|
|
$transaction = $connection->beginTransaction();
|
|
|
try {
|
|
|
- $post = Yii::$app->request->post();
|
|
|
- $id = isset($post['id']) ? $post['id'] : 0;
|
|
|
- $refundType = $post['refundType'] ?? 1;
|
|
|
if ($refundType == RefundOrderClass::REFUND_TYPE_MONEY_GOOD) {
|
|
|
//花材列表结构
|
|
|
// [{productId:0,num:1,unitType:0,unitPrice:12,unitName:'扎'}]
|