diff --git a/application/api/controller/UserWallet.php b/application/api/controller/UserWallet.php index fba36570..3148b731 100644 --- a/application/api/controller/UserWallet.php +++ b/application/api/controller/UserWallet.php @@ -58,7 +58,7 @@ class UserWallet extends BaseCom public function exchange_coin() { $key_name = 'exchange_coin_' . $this->uid; - redis_lock_exit($key_name, 10, 10); + redis_lock_exits($key_name, 10, 10); $earnings_num = input('earnings_num', 0); //最少兑换钻石 $min_earnings_num = get_system_config_value('min_earnings_num'); @@ -66,7 +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); + redis_unlocks($key_name); return V($reslut['code'], $reslut['msg'], $reslut['data']); } diff --git a/application/api/model/UserWallet.php b/application/api/model/UserWallet.php index 4c3d79fd..227c54df 100644 --- a/application/api/model/UserWallet.php +++ b/application/api/model/UserWallet.php @@ -141,7 +141,6 @@ class UserWallet extends Model ]; $re = db::name('vs_user_money_log')->insertAll($account_log); $re1 = db::name('user_wallet')->where('user_id',$uid)->setDec('earnings',$earnings_num); - sleep(5); $re2 = db::name('user_wallet')->where('user_id',$uid)->setInc('coin',$earnings_num * $ear_exchange_coin); if($re && $re1 && $re2){ db::commit();