清除房间不在线用户

This commit is contained in:
2025-09-19 19:22:05 +08:00
parent 3655647b33
commit 4380381a87
2 changed files with 10 additions and 1 deletions

View File

@@ -1723,6 +1723,15 @@ class Room extends Model
'text' => '房间类型已修改type--'.$type
];
model('Chat')->sendMsg(1012,$room_id,$text);
//查询房间里面的用户
$room_user = db::name('vs_room_visitor')->where(['room_id' => $room_id])->select();
if($room_user){
foreach ($room_user as $v){
if(Db::name('user')->where('id', $v['user_id'])->value('is_online') == 0){
model('Room')->quit_room($v['user_id'], $room_id,$v['user_id'],2);
}
}
}
return ['code' => 1, 'msg' => '修改成功', 'data' => null];
}