Commit c439521e by 冷斌

update

parent 2a30f370
...@@ -1249,23 +1249,39 @@ class Model_Home extends PhalApi_Model_NotORM { ...@@ -1249,23 +1249,39 @@ class Model_Home extends PhalApi_Model_NotORM {
*/ */
public function getOnline($touid) public function getOnline($touid)
{ {
$data = []; $where=" islive= '1' and uid={$touid} ";
$p = 0; $configpri=getConfigPri();
while (1) { $result=DI()->notorm->users_live
$p++; ->select("uid,title,city,stream,pull,thumb,isvideo,type,type_val,game_action,goodnum,anyway")
$lists = $this->getHot($p); ->where($where)
if (empty($lists)) { ->order('isrecommend desc,hotvotes desc,starttime desc')
break; ->fetchAll();
foreach($result as $k=>$v){
$nums=DI()->redis->zSize('user_'.$v['stream']);
$v['nums']=(string)$nums;
$userinfo=getUserInfo($v['uid']);
$v['avatar']=$userinfo['avatar'];
$v['avatar_thumb']=$userinfo['avatar_thumb'];
$v['user_nicename']=$userinfo['user_nicename'];
$v['sex']=$userinfo['sex'];
$v['level']=$userinfo['level'];
$v['level_anchor']=$userinfo['level_anchor'];
$v['game']=getGame($v['game_action']);
if(!$v['thumb']){
$v['thumb']=$v['avatar'];
} }
foreach ($lists as $key => $list) { if($v['isvideo']==0 && $configpri['cdn_switch']!=5){
if ($list['uid'] == $touid) { $v['pull']=PrivateKeyA('rtmp',$v['stream'],0);
$list['key'] = $key;
$data = $list;
break;
} }
if($v['type']==1){
$v['type_val']='';
} }
$v['label'] = $this->getUserLabel($userinfo);
$result[$k]=$v;
} }
return $data; return !empty($result) ? $result[0] : [];
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment