|
@@ -277,10 +277,6 @@ class Easemob extends Api
|
|
|
//获取所有麦位,假设8个
|
|
|
$easemob = new Easemoblib();
|
|
|
$seatlist = $easemob->room_getRoomCustomAttribute($easemob_room_id,['seat0','seat1','seat2','seat3','seat4','seat5','seat6','seat7']);
|
|
|
- if(empty($seatlist)){
|
|
|
- //默认为空
|
|
|
- return false;
|
|
|
- }
|
|
|
|
|
|
$newseat = [
|
|
|
'charm' => 0, //红心,魅力值
|
|
@@ -300,27 +296,48 @@ class Easemob extends Api
|
|
|
];
|
|
|
|
|
|
$matedata = [];
|
|
|
- foreach($seatlist as $k => $seat){
|
|
|
- $seat = json_decode($seat,true);
|
|
|
+ if(!empty($seatlist)){
|
|
|
+ foreach($seatlist as $k => $seat){
|
|
|
+ $seat = json_decode($seat,true);
|
|
|
|
|
|
- //找到当前用户所在的麦位
|
|
|
- if(isset($seat['rtcUid']) && !empty($seat['rtcUid']) && $seat['rtcUid'] == $uid){
|
|
|
- //$newseat['seatIndex'] = substr($k,-1);
|
|
|
+ //找到当前用户所在的麦位
|
|
|
+ if(isset($seat['rtcUid']) && !empty($seat['rtcUid']) && $seat['rtcUid'] == $uid){
|
|
|
+ //$newseat['seatIndex'] = substr($k,-1);
|
|
|
|
|
|
- //初始化这个麦位
|
|
|
- $matedata = [
|
|
|
- $k => json_encode($newseat),
|
|
|
- ];
|
|
|
+ //初始化这个麦位
|
|
|
+ $matedata = [
|
|
|
+ $k => json_encode($newseat),
|
|
|
+ ];
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//重置房间在线人数
|
|
|
$matedata['online_user_num'] = count($this->redis->hGetAll("online_".$party_info['id']));
|
|
|
+
|
|
|
+ //删除他点的歌曲
|
|
|
+ $singlist = $easemob->room_getRoomCustomAttribute($easemob_room_id,['waitsing_list']);
|
|
|
+ if(isset($singlist['waitsing_list']) && !empty($singlist['waitsing_list'])){
|
|
|
+ $singlist = json_decode($singlist['waitsing_list'],true);
|
|
|
+
|
|
|
+ //轮询,找到,删除
|
|
|
+ foreach($singlist as $key => $sing){
|
|
|
+ if($sing['userNo'] == $uid){
|
|
|
+ unset($singlist[$key]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $matedata['waitsing_list'] = json_encode($singlist);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //修改属性
|
|
|
if(!empty($matedata)){
|
|
|
$easemob->room_setRoomCustomAttributeForced($easemob_room_id,$party_info['user_id'],$matedata);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|