转币5分钟限制

This commit is contained in:
2026-01-07 13:59:52 +08:00
parent f11fc0a099
commit 53d38e816c

View File

@@ -162,6 +162,13 @@ class UserWallet extends Model
//转币
public function give_coin($uid, $give_uid, $coin){
//从缓存中获取
$exchange_user = Cache::get('give_coin_user_' . $uid);
if($exchange_user){
return ['code' => 0, 'msg' => '请5分钟后再试', 'data' => null];
}else{
Cache::set('give_coin_user_' . $uid, 1, 5 * 60);
}
if(empty($coin)){
return ['code' => 0, 'msg' => '请输入需要转的金币数量', 'data' => null];
}