Browse Source

前台管理员的免密,免踢,免拉黑特权

lizhen_gitee 1 year ago
parent
commit
d847da6379
1 changed files with 7 additions and 7 deletions
  1. 7 7
      application/api/controller/Party.php

+ 7 - 7
application/api/controller/Party.php

@@ -682,14 +682,14 @@ class Party extends Common
             if($hgetlist && $i == 1) $lsetList["manage_restime"] = "";
             // 禁言
             if($hgetlist && $i == 2 && $restime < $hgetlist["time"]) $lsetList["manage_notalk"] = $restime;
-            // 拉黑
-            if($hgetlist && $i == 3 && $restime < $hgetlist["time"]) {
+            // 拉黑,管理员不能被拉黑
+            if($hgetlist && $i == 3 && $restime < $hgetlist["time"] && $this->auth->is_manager == 0) {
                 $restime = date("Y-m-d H:i:s",($hgetlist["time"]+$hgetlist["createtime"]));
                 $this->error(__('您已被该房间拉黑,解除时间:'.$restime));
                 break;
             }
-            // 踢出
-            if($hgetlist && $i == 4 && $restime < $hgetlist["time"]) {
+            // 踢出,管理员不能被踢出
+            if($hgetlist && $i == 4 && $restime < $hgetlist["time"] && $this->auth->is_manager == 0) {
                 $restime = date("Y-m-d H:i:s",($hgetlist["time"]+$hgetlist["createtime"]));
                 $this->error(__('您已被该房间踢出,解除时间:'.$restime));
                 break;
@@ -705,7 +705,7 @@ class Party extends Common
             //if($partyInfo["status"] != 1) $this->error("该房间为预创建房间,请联系管理员正式开通!");
 
             if(isset($partyInfo["party_pass"]) && $partyInfo["party_pass"] && $partyInfo["user_id"] != $user_id) {
-                if(($party_pass != $partyInfo["party_pass"] || strlen($party_pass) != 4) && $this->auth->id != 4) {
+                if(($party_pass != $partyInfo["party_pass"] || strlen($party_pass) != 4) && $this->auth->is_manager == 0) {
                     $this->error("派对密码不正确!");
                 }
             }
@@ -716,7 +716,7 @@ class Party extends Common
                 // 获取公会管理员
                 $guildMemberInfo = \app\common\model\GuildMember::where(["user_id" => $user_id, "guild_id" => $guildInfo['id'], 'status' => 1])->find();
                 if ($guildMemberInfo && $guildMemberInfo['role'] == 0) {
-                    $this->error("当前直播已结束!");
+                    $this->error("当前直播已结束!");//这种情况理论上不存在
                 }
             }
 //            // 如果是房主自己进入房间,则更新用户 为在线状态
@@ -1478,7 +1478,7 @@ class Party extends Common
         $data = [];
         $data["status"] = 0;
         $data["is_pass"] = $partyInfo["party_pass"]?1:0;
-        if($partyInfo["user_id"] == $user_id || $this->auth->mobile == '17353993050') $data["is_pass"] = 0;
+        if($partyInfo["user_id"] == $user_id || $this->auth->is_manager == 1){ $data["is_pass"] = 0;}
 
         if($is_miniprogram == 1) { // 小程序单独处理
             // 判断当前用户是否被该房间设置限制 //项目:1=房管,2=禁言,3=拉黑,4=踢出