Commit c74fbc66 by 冷斌

add

parent b787bd47
......@@ -32,6 +32,7 @@ class Api_Home extends PhalApi_Api {
'uid' => array('name' => 'uid', 'type' => 'int', 'require' => true, 'min'=>1 ,'desc' => '用户ID'),
'key' => array('name' => 'key', 'type' => 'string', 'default'=>'' ,'desc' => '用户ID'),
'p' => array('name' => 'p', 'type' => 'int', 'default'=>'1' ,'desc' => '页数'),
'type'=>array('name' => 'type', 'type' => 'int', 'default'=>0 ,'desc' => '类型'),
),
'interest' => array(
......@@ -364,7 +365,7 @@ class Api_Home extends PhalApi_Api {
}
$domain = new Domain_Home();
$info = $domain->search($uid,$key,$p);
$info = $domain->search($uid,$key,$p, $this->type);
$rs['info'] = $info;
......
......@@ -55,11 +55,11 @@ class Domain_Home {
return $rs;
}
public function search($uid,$key,$p) {
public function search($uid,$key,$p, $type) {
$rs = array();
$model = new Model_Home();
$rs = $model->search($uid,$key,$p);
$rs = $model->search($uid,$key,$p, $type);
return $rs;
}
......
......@@ -378,7 +378,7 @@ class Model_Home extends PhalApi_Model_NotORM {
}
/* 搜索 */
public function search($uid,$key,$p) {
public function search($uid,$key,$p,$type) {
if($p<1){
$p=1;
}
......@@ -408,6 +408,15 @@ class Model_Home extends PhalApi_Model_NotORM {
->where('touid=?',$v['id'])
->count();
$v['fans']=$touids;
if ($type) {
$one = DI()->notorm->family->where("uid = {$v['id']} and state = 2")->count();
$two = DI()->notorm->users_family->where("uid = {$v['id']} and state = 2")->count();
$type = 0;
if ($one || $two) {
$type = 1;
}
$v['fans']=$type;
}
$result[$k]=$v;
}
......
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