Browse Source

进入房间显示主播头像、主播名字

urbanu619 6 months ago
parent
commit
e27f79c0eb
1 changed files with 9 additions and 3 deletions
  1. 9 3
      web/PhalApi/Appapi/Api/Live.php

+ 9 - 3
web/PhalApi/Appapi/Api/Live.php

@@ -783,7 +783,6 @@ class Api_Live extends PhalApi_Api {
             DI()->redis->expire($token, $expiretime);
         }
 		
-		
         /* 用户列表 */
         $userlists=$this->getUserList($liveuid,$stream);
 		$configpri=getConfigPri();
@@ -808,7 +807,13 @@ class Api_Live extends PhalApi_Api {
 		if($live_info['isvideo']!=1){
 			$pull=PrivateKeyA('rtmp',$stream,0);
 		}
-	
+
+        // 获取主播的 头像=live_avatar , 名字=live_nicename
+        $live_info_json = DI()->redis  -> get('userinfo_'.$liveuid);
+        $live_d = json_decode($live_info_json, true);
+        $info['user_nicename'] = $live_d['user_nicename'];
+        $info['live_avatar'] = $live_d['live_avatar'];
+
 		$info['pull']=html_entity_decode($pull);
 		$info['userlists']=$userlists['userlist'];
         
@@ -827,8 +832,9 @@ class Api_Live extends PhalApi_Api {
 		$info['sensitive_words']=$dirtyarr;
 
 
+        $result = array_merge($live_d, $info);
 
-		$rs['info'][0]=$info;
+		$rs['info'][0]=$result;
 		return $rs;
 	}