|
@@ -931,10 +931,10 @@ class Party extends Api
|
|
|
*/
|
|
|
public function outParty() {
|
|
|
$party_id = input('party_id',0,"intval");
|
|
|
+ $room_type = input("room_type",1);
|
|
|
if (!$party_id) {
|
|
|
$this->error(__('Invalid parameters'));
|
|
|
}
|
|
|
- $user_u_id = $this->auth->u_id;
|
|
|
$userId = $this->auth->id;
|
|
|
|
|
|
|
|
@@ -947,34 +947,24 @@ class Party extends Api
|
|
|
$this->redis->hDel("livingUser", $this->auth->id);
|
|
|
|
|
|
|
|
|
- $partyInfo = $this->redis->get("party_" . $party_id);
|
|
|
+ $partyInfo = $this->redis->get($this->roomTypeArr[$room_type].'_'.$party_id);
|
|
|
if ($partyInfo) {
|
|
|
$partyInfo = json_decode($partyInfo, true);
|
|
|
$memCount = count($this->redis->hGetAll("online_" . $party_id));
|
|
|
if ($memCount <= 0) {
|
|
|
$partyInfo["is_online"] = 0;
|
|
|
- $this->redis->set("party_" . $party_id, json_encode($partyInfo));
|
|
|
+ $this->redis->set($this->roomTypeArr[$room_type].'_'.$party_id,json_encode($partyInfo));
|
|
|
\app\common\model\Party::update(["is_online" => 0], ["id" => $party_id]);
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- $liveInfo = $this->redis->get("live_" . $party_id);
|
|
|
- if ($liveInfo) {
|
|
|
- $liveInfo = json_decode($liveInfo, true);
|
|
|
- $memCount = count($this->redis->hGetAll("online_" . $party_id));
|
|
|
- if ($memCount <= 0) {
|
|
|
- $liveInfo["is_online"] = 0;
|
|
|
- $this->redis->set("live_" . $party_id, json_encode($liveInfo));
|
|
|
- \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);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- $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("退出成功!",[]);
|
|
|
}
|