Commit 31e4675a by 冷斌

踢人

parent da52028f
...@@ -17,6 +17,7 @@ class Api_Live extends PhalApi_Api { ...@@ -17,6 +17,7 @@ class Api_Live extends PhalApi_Api {
'anyway' => array('name' => 'anyway', 'type' => 'int', 'default'=>'0', 'desc' => '直播类型 1 PC, 0 app'), 'anyway' => array('name' => 'anyway', 'type' => 'int', 'default'=>'0', 'desc' => '直播类型 1 PC, 0 app'),
'liveclassid' => array('name' => 'liveclassid', 'type' => 'int', 'default'=>'0', 'desc' => '直播分类ID'), 'liveclassid' => array('name' => 'liveclassid', 'type' => 'int', 'default'=>'0', 'desc' => '直播分类ID'),
'deviceinfo' => array('name' => 'deviceinfo', 'type' => 'string', 'default'=>'', 'desc' => '设备信息'), 'deviceinfo' => array('name' => 'deviceinfo', 'type' => 'string', 'default'=>'', 'desc' => '设备信息'),
'isNear' => array('name' => 'isNear', 'type' => 'int', 'default'=>0, 'desc' => '是否附近可见'),
), ),
'changeLive' => array( 'changeLive' => array(
'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'), 'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
...@@ -466,7 +467,7 @@ class Api_Live extends PhalApi_Api { ...@@ -466,7 +467,7 @@ class Api_Live extends PhalApi_Api {
); );
$domain = new Domain_Live(); $domain = new Domain_Live();
$result = $domain->createRoom($uid,$dataroom,$thumb); $result = $domain->createRoom($uid,$dataroom,$thumb, $this->isNear);
if($result===false){ if($result===false){
$rs['code'] = 1011; $rs['code'] = 1011;
$rs['msg'] = '开播失败,请重试'; $rs['msg'] = '开播失败,请重试';
......
...@@ -10,11 +10,11 @@ class Domain_Live { ...@@ -10,11 +10,11 @@ class Domain_Live {
return $rs; return $rs;
} }
public function createRoom($uid,$data,$thumb) { public function createRoom($uid,$data,$thumb, $isNear) {
$rs = array(); $rs = array();
$model = new Model_Live(); $model = new Model_Live();
$rs = $model->createRoom($uid,$data,$thumb); $rs = $model->createRoom($uid,$data,$thumb,$isNear);
return $rs; return $rs;
} }
......
...@@ -543,7 +543,7 @@ class Model_Home extends PhalApi_Model_NotORM { ...@@ -543,7 +543,7 @@ class Model_Home extends PhalApi_Model_NotORM {
} }
$pnum=50; $pnum=50;
$start=($p-1)*$pnum; $start=($p-1)*$pnum;
$where=" islive='1' and lng!='' and lat!='' "; $where="is_near = '1' and islive='1' and lng!='' and lat!='' ";
$configpri=getConfigPri(); $configpri=getConfigPri();
$result=DI()->notorm->users_live $result=DI()->notorm->users_live
->select("uid,thumb,title,province,city,stream,lng,lat,pull,isvideo,thumb,islive,type,type_val,game_action,goodnum,anyway,getDistance('{$lat}','{$lng}',lat,lng) as distance") ->select("uid,thumb,title,province,city,stream,lng,lat,pull,isvideo,thumb,islive,type,type_val,game_action,goodnum,anyway,getDistance('{$lat}','{$lng}',lat,lng) as distance")
......
...@@ -2,12 +2,13 @@ ...@@ -2,12 +2,13 @@
class Model_Live extends PhalApi_Model_NotORM { class Model_Live extends PhalApi_Model_NotORM {
/* 创建房间 */ /* 创建房间 */
public function createRoom($uid,$data,$thumb) { public function createRoom($uid,$data,$thumb,$isNear) {
/* 获取主播 推荐、热门 */ /* 获取主播 推荐、热门 */
$data['ishot']='0'; $data['ishot']='0';
$data['isrecommend']='0'; $data['isrecommend']='0';
$data['isrecommend2']='0'; $data['isrecommend2']='0';
$data['is_near'] = $isNear;
$userinfo=DI()->notorm->users $userinfo=DI()->notorm->users
->select("ishot,isrecommend,isrecommend2") ->select("ishot,isrecommend,isrecommend2")
->where('id=?',$uid) ->where('id=?',$uid)
......
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