Commit c74fbc66 by 冷斌

add

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