房间用户列表

This commit is contained in:
2025-12-09 18:00:28 +08:00
parent 65abf4fb59
commit d31b8e1960

View File

@@ -1808,18 +1808,13 @@ class Room extends Model
$lists['on_pit'] = [];
$lists['off_pit'] = [];
$lists['count'] = db::name('vs_room_visitor')->where(['room_id' => $room_id])->count();
$where = ['a.room_id' => $room_id];
if ($page != 1) {
$where['a.is_onpit'] = 1;//不在麦位上的用户
$where['b.hide_status'] = 0;//非隐身用户
}
$where = ['a.room_id' => $room_id];
$lists['count'] = db::name('vs_room_visitor')->where($where)->count();
$list = db::name('vs_room_visitor')->alias('a')
->join('user b', 'a.user_id = b.id','left')
->field('a.id,a.user_id,b.nickname,b.avatar,b.hide_status,a.is_onpit')
->where($where)
// ->order('a.is_onpit asc,a.id asc')
->page($page, $limit)
->select();
if ($list) {
@@ -1837,7 +1832,12 @@ class Room extends Model
$v['pit_number'] = $role['pit_number'];
if ($page != 1) {
$lists['off_pit'][] = $v;
// $lists['off_pit'][] = $v;
if ($v['is_onpit'] == 1) {//bu在麦位上的用户
if($v['hide_status'] == 0){//非隐身用户
$lists['off_pit'][] = $v;
}
}
} else {
if ($v['is_onpit'] == 1) {//bu在麦位上的用户
if($v['hide_status'] == 0){//非隐身用户