转币5分钟限制

This commit is contained in:
2026-01-07 14:13:19 +08:00
parent 53d38e816c
commit fb9963d49f

View File

@@ -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);
}