|
|
@@ -93,6 +93,16 @@ class CustomController extends BaseController
|
|
|
if ($amount <= 0) {
|
|
|
//util::fail('充值金额需要大于0');
|
|
|
}
|
|
|
+
|
|
|
+ //解决重复充值问题
|
|
|
+ $cacheKey = 'help_custom_recharge_' . $customId;
|
|
|
+ $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
|
|
|
+ if (!empty($has)) {
|
|
|
+ util::fail('刚有提交充值,请60秒之后');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 60, 'has']);
|
|
|
+
|
|
|
$custom = CustomClass::getLockById($customId);
|
|
|
if (empty($custom)) {
|
|
|
util::fail('没有找到客户');
|