|
@@ -137,7 +137,7 @@ class Easemob extends Api
|
|
|
$this->updatePosition($uid,$v["GroupId"]);
|
|
|
|
|
|
// 取消排麦
|
|
|
- $this->cancelLineup($uid,$v["GroupId"]);
|
|
|
+ //$this->cancelLineup($uid,$v["GroupId"]);
|
|
|
|
|
|
// 房间状态变更
|
|
|
$partyInfo = $this->redis->get("party_".$v["GroupId"]);
|
|
@@ -288,7 +288,8 @@ class Easemob extends Api
|
|
|
|
|
|
//退出房间获取房间自定义属性
|
|
|
//清理这个人的麦序
|
|
|
- $this->clean_seat($roomId,$uid);
|
|
|
+ //重置房间在线人数
|
|
|
+ $this->clean_room($roomId,$uid);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -299,9 +300,9 @@ class Easemob extends Api
|
|
|
}
|
|
|
|
|
|
//清除某个麦位
|
|
|
- private function clean_seat($easemob_room_id,$uid){
|
|
|
+ private function clean_room($easemob_room_id,$uid){
|
|
|
|
|
|
- $party_info = Db::name('party')->where('easemob_room_id',$easemob_room_id)->find();
|
|
|
+ $party_info = Db::name('party')->field('id,user_id')->where('easemob_room_id',$easemob_room_id)->find();
|
|
|
if(empty($party_info)){
|
|
|
return false;
|
|
|
}
|
|
@@ -328,19 +329,28 @@ class Easemob extends Api
|
|
|
'isVideoMuted' => 0, // 是否开启视频
|
|
|
];
|
|
|
|
|
|
+ $matedata = [];
|
|
|
foreach($seatlist as $k => $seat){
|
|
|
$seat = json_decode($seat,true);
|
|
|
+
|
|
|
+ //找到当前用户所在的麦位
|
|
|
if(isset($seat['rtcUid']) && !empty($seat['rtcUid']) && $seat['rtcUid'] == $uid){
|
|
|
$newseat['seatIndex'] = $seat['seatIndex'];
|
|
|
|
|
|
- //重新设置
|
|
|
+ //初始化这个麦位
|
|
|
$matedata = [
|
|
|
$k => json_encode($newseat),
|
|
|
];
|
|
|
- $easemob->room_setRoomCustomAttributeForced($easemob_room_id,$party_info['user_id'],$matedata);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //房间在线人数
|
|
|
+ $matedata['online_user_num'] = count($this->redis->hGetAll("online_".$party_info['id']));
|
|
|
+ if(!empty($matedata)){
|
|
|
+ $easemob->room_setRoomCustomAttributeForced($easemob_room_id,$party_info['user_id'],$matedata);
|
|
|
+ }
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|