Commit 58f7c5d4 by 冷斌

踢人

parent a1de5404
...@@ -48,9 +48,9 @@ class Api_Livepk extends PhalApi_Api { ...@@ -48,9 +48,9 @@ class Api_Livepk extends PhalApi_Api {
$p=1; $p=1;
} }
$where="uid!={$uid}"; $where="ul.uid!={$uid}";
if (!empty($name)) { if (!empty($name)) {
$where .= " and users.user_nicename like '%".$name."%'"; $where .= " and u.user_nicename like '%".$name."%'";
} }
$domain = new Domain_Livepk(); $domain = new Domain_Livepk();
......
...@@ -9,13 +9,21 @@ class Model_Livepk extends PhalApi_Model_NotORM { ...@@ -9,13 +9,21 @@ class Model_Livepk extends PhalApi_Model_NotORM {
$pnum=50; $pnum=50;
$start=($p-1)*$pnum; $start=($p-1)*$pnum;
$sql = "select ul.uid, ul.stream, ul.pkuid from cmf_users_live as ul left join cmf_users as u on u.id = ul.uid where";
// $sql .= " ul.islive=1 and ul.isvideo=0 ";
$sql .= " 1=1 ";
$sql .= " and {$where} ";
$sql .= " order by ul.starttime desc ";
$sql .= " limit {$start}, {$pnum} ";
$list=DI()->notorm->users_live $list=DI()->notorm->users_live
->select('uid, stream, pkuid') ->queryAll($sql);
// ->where('cmf_users_live.islive=1 and cmf_users_live.isvideo=0') // ->select('uid, stream, pkuid')
->where($where) //// ->where('cmf_users_live.islive=1 and cmf_users_live.isvideo=0')
->order('starttime desc') // ->where($where)
->limit($start,$pnum) // ->order('starttime desc')
->fetchAll(); // ->limit($start,$pnum)
// ->fetchAll();
foreach($list as $k=>$v){ foreach($list as $k=>$v){
$userinfo=getUserInfo($v['uid']); $userinfo=getUserInfo($v['uid']);
$v['avatar']=$userinfo['avatar']; $v['avatar']=$userinfo['avatar'];
......
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