Commit 39be8171 by 冷斌

踢人

parent fc745002
......@@ -7,6 +7,7 @@ class Api_Livepk extends PhalApi_Api {
'getLiveList' => array(
'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
'p' => array('name' => 'p', 'type' => 'int', 'default' => 1, 'desc' => '页码'),
'name' => array('name' => 'name', 'type' => 'string', 'default' => '', 'desc' => '搜索'),
),
'search' => array(
......@@ -42,11 +43,15 @@ class Api_Livepk extends PhalApi_Api {
$uid=checkNull($this->uid);
$p=checkNull($this->p);
$name = checkNull($this->name);
if(!$p){
$p=1;
}
$where="cmf_users_live.uid!={$uid}";
if (!$name) {
$where .= " and cmf_users.user_nicename like '%".$name."%'";
}
$domain = new Domain_Livepk();
$list = $domain->getLiveList($uid,$where,$p);
......
......@@ -13,6 +13,7 @@ class Model_Livepk extends PhalApi_Model_NotORM {
->select('cmf_users_live.uid, cmf_users_live.stream, cmf_users_live.pkuid')
// ->where('cmf_users_live.islive=1 and cmf_users_live.isvideo=0')
->where($where)
->join('cmf_users', 'cmf_users.id = cmf_users_live.uid')
->order('cmf_users_live.starttime desc')
->limit($start,$pnum)
->fetchAll();
......
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