转币5分钟限制
This commit is contained in:
@@ -123,7 +123,9 @@ class UserWallet extends Model
|
||||
//从缓存中获取
|
||||
$exchange_user = Cache::get('exchange_user_' . $uid);
|
||||
if($exchange_user){
|
||||
return ['code' => 0, 'msg' => '请5分钟后再次兑换', 'data' => null];
|
||||
//获取缓存的过期剩余 时间
|
||||
$time = Cache::store('redis')->handler()->ttl('exchange_user_' . $uid);
|
||||
return ['code' => 0, 'msg' => '请'.$time.'秒后再次兑换', 'data' => null];
|
||||
}else{
|
||||
Cache::set('exchange_user_' . $uid, 1, 5 * 60);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user