Browse Source

派对初始化麦位

lizhen_gitee 1 year ago
parent
commit
4704f04422
1 changed files with 10 additions and 1 deletions
  1. 10 1
      application/api/controller/Party.php

+ 10 - 1
application/api/controller/Party.php

@@ -163,7 +163,7 @@ class Party extends Common
             $seatdata = [];
             for($i=1;$i<=$seatnum;$i++){
                 $seat = [
-                    'charm'    => '',                    //红心,魅力值
+                    'charm'    => 0,                    //红心,魅力值
 
                     'isMaster'       => false,            // 是否是房主
                     'headUrl'        => '',              // 头像
@@ -175,6 +175,15 @@ class Party extends Common
                     'isAudioMuted'   => 1,            // 是否静音
                     'isVideoMuted'   => 0,            // 是否开启视频
                 ];
+
+                if($i == 1){
+                    $seat['isMaster'] = true;
+                    $seat['headUrl']  = localpath_to_netpath($this->auth->avatar);
+                    $seat['userNo']   = $this->auth->id;
+                    $seat['rtcUid']   = $this->auth->id;
+                    $seat['name']     = $this->auth->nickname;
+                }
+
                 $seatdata['seat'.$i] = json_encode($seat);
             }
             $rs = $easemob->room_setRoomCustomAttributeForced($easemob_room_id,$this->auth->id,$seatdata);