Commit c439521e by 冷斌

update

parent 2a30f370
......@@ -1249,23 +1249,39 @@ class Model_Home extends PhalApi_Model_NotORM {
*/
public function getOnline($touid)
{
$data = [];
$p = 0;
while (1) {
$p++;
$lists = $this->getHot($p);
if (empty($lists)) {
break;
$where=" islive= '1' and uid={$touid} ";
$configpri=getConfigPri();
$result=DI()->notorm->users_live
->select("uid,title,city,stream,pull,thumb,isvideo,type,type_val,game_action,goodnum,anyway")
->where($where)
->order('isrecommend desc,hotvotes desc,starttime desc')
->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 ($list['uid'] == $touid) {
$list['key'] = $key;
$data = $list;
break;
if($v['isvideo']==0 && $configpri['cdn_switch']!=5){
$v['pull']=PrivateKeyA('rtmp',$v['stream'],0);
}
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