|
@@ -753,6 +753,39 @@ class Party extends Api
|
|
}
|
|
}
|
|
$user_id = $this->auth->id;
|
|
$user_id = $this->auth->id;
|
|
|
|
|
|
|
|
+ // 判断派对密码
|
|
|
|
+ $partyInfo = $this->redis->get($this->roomTypeArr[$room_type]."_".$party_id);
|
|
|
|
+ if($partyInfo) {
|
|
|
|
+ $partyInfo = json_decode($partyInfo,true);
|
|
|
|
+
|
|
|
|
+ if($partyInfo["is_close"] == 1) $this->error("该房间已被关闭!");
|
|
|
|
+ //if($partyInfo["status"] != 1) $this->error("该房间为预创建房间,请联系管理员正式开通!");
|
|
|
|
+ $partyManage = $this->redis->hGet("party_manage_".$party_id,$user_id."-1");
|
|
|
|
+ if(isset($partyInfo["party_pass"]) && $partyInfo["party_pass"] && $partyInfo["user_id"] != $user_id && empty($partyManage)) {
|
|
|
|
+ if(($party_pass != $partyInfo["party_pass"] || strlen($party_pass) != 4) && $this->auth->is_manager == 0) {
|
|
|
|
+ $this->error("派对密码不正确!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 公会管理员和公会长激活派对厅
|
|
|
|
+ /* $guildInfo = \app\common\model\Guild::where(['user_id' => $partyInfo['user_id'], 'status' => 1])->find();
|
|
|
|
+ if ($guildInfo) {
|
|
|
|
+ // 获取公会管理员
|
|
|
|
+ $guildMemberInfo = \app\common\model\GuildMember::where(["user_id" => $user_id, "guild_id" => $guildInfo['id'], 'status' => 1])->find();
|
|
|
|
+ if ($guildMemberInfo && $guildMemberInfo['role'] == 0 && $partyInfo['is_online'] == 0) {
|
|
|
|
+ //$this->error("当前直播已结束!");//这种情况理论上不存在
|
|
|
|
+ }
|
|
|
|
+ }*/
|
|
|
|
+// // 如果是房主自己进入房间,则更新用户 为在线状态
|
|
|
|
+// if ($partyInfo["user_id"] == $user_id) {
|
|
|
|
+// if ($room_type == 2)
|
|
|
|
+// \app\common\model\User::update(["is_live" => 1], ["id" => $partyInfo["user_id"]]);
|
|
|
|
+// }
|
|
|
|
+ } else {
|
|
|
|
+ $this->error("派对信息获取失败!");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
// 判断当前用户是否被该房间设置限制 //项目:1=房管,2=禁言,3=拉黑,4=踢出
|
|
// 判断当前用户是否被该房间设置限制 //项目:1=房管,2=禁言,3=拉黑,4=踢出
|
|
$lsetList = [];
|
|
$lsetList = [];
|
|
@@ -769,9 +802,15 @@ class Party extends Api
|
|
}
|
|
}
|
|
|
|
|
|
// 房管
|
|
// 房管
|
|
- if($hgetlist && $i == 1) $lsetList["manage_restime"] = "";
|
|
|
|
|
|
+ if($hgetlist && $i == 1) {
|
|
|
|
+ $lsetList["manage_restime"] = "";
|
|
|
|
+ //重新设置成管理员
|
|
|
|
+ $this->setGroupAdmin($partyInfo['easemob_room_id'],$user_id,1);
|
|
|
|
+ }
|
|
// 禁言
|
|
// 禁言
|
|
- if($hgetlist && $i == 2 && $restime < $hgetlist["time"]) $lsetList["manage_notalk"] = $restime;
|
|
|
|
|
|
+ if($hgetlist && $i == 2 && $restime < $hgetlist["time"]) {
|
|
|
|
+ $lsetList["manage_notalk"] = $restime;
|
|
|
|
+ }
|
|
// 拉黑,管理员不能被拉黑
|
|
// 拉黑,管理员不能被拉黑
|
|
if($hgetlist && $i == 3 && $restime < $hgetlist["time"] && $this->auth->is_manager == 0) {
|
|
if($hgetlist && $i == 3 && $restime < $hgetlist["time"] && $this->auth->is_manager == 0) {
|
|
$restime = date("Y-m-d H:i:s",($hgetlist["time"]+$hgetlist["createtime"]));
|
|
$restime = date("Y-m-d H:i:s",($hgetlist["time"]+$hgetlist["createtime"]));
|
|
@@ -786,37 +825,6 @@ class Party extends Api
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- // 判断派对密码
|
|
|
|
- $partyInfo = $this->redis->get($this->roomTypeArr[$room_type]."_".$party_id);
|
|
|
|
- if($partyInfo) {
|
|
|
|
- $partyInfo = json_decode($partyInfo,true);
|
|
|
|
-
|
|
|
|
- if($partyInfo["is_close"] == 1) $this->error("该房间已被关闭!");
|
|
|
|
- //if($partyInfo["status"] != 1) $this->error("该房间为预创建房间,请联系管理员正式开通!");
|
|
|
|
- $partyManage = $this->redis->hGet("party_manage_".$party_id,$user_id."-1");
|
|
|
|
- if(isset($partyInfo["party_pass"]) && $partyInfo["party_pass"] && $partyInfo["user_id"] != $user_id && empty($partyManage)) {
|
|
|
|
- if(($party_pass != $partyInfo["party_pass"] || strlen($party_pass) != 4) && $this->auth->is_manager == 0) {
|
|
|
|
- $this->error("派对密码不正确!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 公会管理员和公会长激活派对厅
|
|
|
|
- /* $guildInfo = \app\common\model\Guild::where(['user_id' => $partyInfo['user_id'], 'status' => 1])->find();
|
|
|
|
- if ($guildInfo) {
|
|
|
|
- // 获取公会管理员
|
|
|
|
- $guildMemberInfo = \app\common\model\GuildMember::where(["user_id" => $user_id, "guild_id" => $guildInfo['id'], 'status' => 1])->find();
|
|
|
|
- if ($guildMemberInfo && $guildMemberInfo['role'] == 0 && $partyInfo['is_online'] == 0) {
|
|
|
|
- //$this->error("当前直播已结束!");//这种情况理论上不存在
|
|
|
|
- }
|
|
|
|
- }*/
|
|
|
|
-// // 如果是房主自己进入房间,则更新用户 为在线状态
|
|
|
|
-// if ($partyInfo["user_id"] == $user_id) {
|
|
|
|
-// if ($room_type == 2)
|
|
|
|
-// \app\common\model\User::update(["is_live" => 1], ["id" => $partyInfo["user_id"]]);
|
|
|
|
-// }
|
|
|
|
- } else {
|
|
|
|
- $this->error("派对信息获取失败!");
|
|
|
|
- }
|
|
|
|
|
|
|
|
//下移
|
|
//下移
|
|
$this->redis->zAdd("party_user_".$party_id,$user_id,$user_id);
|
|
$this->redis->zAdd("party_user_".$party_id,$user_id,$user_id);
|
|
@@ -1217,7 +1225,7 @@ class Party extends Api
|
|
$this->success("获取成功!",\app\common\model\PartyBackground::where(["room_type"=>$room_type])->select());
|
|
$this->success("获取成功!",\app\common\model\PartyBackground::where(["room_type"=>$room_type])->select());
|
|
}
|
|
}
|
|
|
|
|
|
- //腾讯im设置管理员
|
|
|
|
|
|
+ //环信聊天室设置管理员,type=1设置,type=0移除
|
|
private function setGroupAdmin($easemob_room_id,$user_id,$type = 1)
|
|
private function setGroupAdmin($easemob_room_id,$user_id,$type = 1)
|
|
{
|
|
{
|
|
$easemob = new Easemob();
|
|
$easemob = new Easemob();
|