Selaa lähdekoodia

取消排麦里加抱麦功能

lizhen_gitee 1 vuosi sitten
vanhempi
commit
4d146e9b7e
1 muutettua tiedostoa jossa 11 lisäystä ja 0 poistoa
  1. 11 0
      application/api/controller/Party.php

+ 11 - 0
application/api/controller/Party.php

@@ -1469,6 +1469,17 @@ class Party extends Api
         if(empty($seatlist)){
             $matedata['seat1'] = $newseat;
         }else{
+            //第一遍轮询麦位,尝试找到这个人,如果找到在任何一个麦位,立刻return
+            foreach($seatlist as $k => $seat){
+                $seat = json_decode($seat,true);
+
+                //找到当前用户所在的麦位
+                if(isset($seat['rtcUid']) && !empty($seat['rtcUid']) && $seat['rtcUid'] == $user_id){
+                    return true;
+                }
+            }
+
+            //第二遍轮询麦位,找一个空麦位,放进去
             $matedata = [];
             foreach($seatlist as $k => $seat){
                 $seat = json_decode($seat,true);