//获取所有的粉丝
private function _getChildren($data,$parent_id,$isClear=false,$level=0)
{
static $ret = array();
if($isClear)
$ret = array();
foreach ($data as $k=>$v){
if($v['parent_id1']==$parent_id){
$v['level'] = $level;
$ret[] = $v;
$this->_getChildren($data,$v['source'],false,$level+1);
}
}
return $ret;
}
// 获取所有的爹
public function _getDad($data,$uid,$isClear=false,$level=0)
{
static $res = array();
if($isClear){
$res = array();
}
foreach ($data as $k=>$v){
if($v['uid']==$uid){
$v['level'] = $level;
$res[] = $v['parent_uid'];
$this->_getDad($data,$v['parent_uid'],false,$level+1);
}
}
return $res;
}