diff --git a/application/api/controller/UserWallet.php b/application/api/controller/UserWallet.php index 2f4e1976..1c0edae6 100644 --- a/application/api/controller/UserWallet.php +++ b/application/api/controller/UserWallet.php @@ -57,6 +57,8 @@ class UserWallet extends BaseCom //收益(钻石)兑换金币 public function exchange_coin() { + $key_name = 'exchange_coin_' . $this->uid; + redis_lock_exit($key_name); $earnings_num = input('earnings_num', 0); //最少兑换钻石 $min_earnings_num = get_system_config_value('min_earnings_num'); @@ -64,6 +66,7 @@ class UserWallet extends BaseCom return V(0, '兑换金额不能小于' . $min_earnings_num); } $reslut = model('UserWallet')->exchange_coin($this->uid,$earnings_num); + redis_unlock($key_name); return V($reslut['code'], $reslut['msg'], $reslut['data']); }