|
@@ -67,16 +67,16 @@ class Party extends Common
|
|
|
//party_jewel_to_1:20231120w,live_jewel_to_1:20231120w 本周第一天
|
|
|
//party_jewel_to_1:20231101m,live_jewel_to_1:20231101m 本月第一天
|
|
|
|
|
|
- //在线人列表
|
|
|
+ //在线人列表。hSet增加,HDel减少, hGetAll来使用。大多用来计算数量 count(hGetAll),少数获取用户列表
|
|
|
//online_1
|
|
|
|
|
|
+ //房间列表页的用户头像 。zAdd增加,zRem减少,zRange来使用。 party_user_1 总是 与 online_1 共同出现,加的时候一起加,减的时候一起减。多处维护,只有 RoomService/getPartyUserList 这个方法有使用到
|
|
|
+ //party_user_1
|
|
|
+
|
|
|
//用户进房
|
|
|
//joinParty_days
|
|
|
|
|
|
- //首页用户头像
|
|
|
- //party_user_1
|
|
|
-
|
|
|
- //在线用户在房间情况
|
|
|
+ //在线用户在房间情况。当前用户在哪个房间
|
|
|
//livingUser
|
|
|
|
|
|
//派对管理 1=房管,2=禁言,3=拉黑,4=踢出
|
|
@@ -753,7 +753,7 @@ class Party extends Common
|
|
|
}
|
|
|
$user_id = $this->auth->id;
|
|
|
|
|
|
- $this->redis->zAdd("party_user_".$party_id,$this->auth->u_id,$user_id);
|
|
|
+ $this->redis->zAdd("party_user_".$party_id,$user_id,$user_id);
|
|
|
$this->redis->hSet("online_".$party_id,$user_id,$user_id); //新增的
|
|
|
|
|
|
// 判断当前用户是否存在在直播间通过切换过来的
|
|
@@ -877,12 +877,16 @@ class Party extends Common
|
|
|
//声网三个token
|
|
|
$lsetList['shengwang_token'] = $this->shengwang_token($partyInfo['easemob_room_id'],1);
|
|
|
|
|
|
- //更新聊天室自定义属性 用户列表
|
|
|
+ //[环信] 更新聊天室自定义属性 在线用户人数
|
|
|
+ $easemob = new Easemob();
|
|
|
+ $matedata = [
|
|
|
+ 'online_user_num' => count($this->redis->hGetAll("online_".$party_id)),
|
|
|
+ ];
|
|
|
+ $easemob->room_setRoomCustomAttributeForced($partyInfo['easemob_room_id'],$partyInfo['user_id'],$matedata);
|
|
|
|
|
|
return $this->success("加入成功!",$lsetList);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 判断是否被禁言
|
|
|
*/
|
|
@@ -927,7 +931,6 @@ class Party extends Common
|
|
|
$this->redis->zRem("party_user_".$party_id,$userId);
|
|
|
|
|
|
// 处理online_party_id
|
|
|
- //$this->redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
$this->redis->HDel("online_" . $party_id, $this->auth->id);
|
|
|
|
|
|
// 扣除在线用户在房间情况
|
|
@@ -955,6 +958,14 @@ class Party extends Common
|
|
|
\app\common\model\Party::update(["is_online" => 0], ["id" => $party_id]);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //[环信] 更新聊天室自定义属性 在线用户人数
|
|
|
+ $easemob = new Easemob();
|
|
|
+ $matedata = [
|
|
|
+ 'online_user_num' => count($this->redis->hGetAll("online_".$party_id)),
|
|
|
+ ];
|
|
|
+ $easemob->room_setRoomCustomAttributeForced($partyInfo['easemob_room_id'],$partyInfo['user_id'],$matedata);
|
|
|
+
|
|
|
return $this->success("退出成功!",[]);
|
|
|
}
|
|
|
|