Skip to content

Instantly share code, notes, and snippets.

@phpdever
Last active April 1, 2017 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpdever/0073d5d99d97e23741011e52fd06e950 to your computer and use it in GitHub Desktop.
Save phpdever/0073d5d99d97e23741011e52fd06e950 to your computer and use it in GitHub Desktop.
获取用户关系树
public function getDown(&$fenxiaos,$userid){
$user=M('user');
$where = array(
'shares_tree' => array('like','%|'.$userid.'|-%'),
'status' => 1,
'uid'=>array('in',array('2','3','5'))
);
$users=$user->where($where)->field('id')->select();
foreach($users as $key=>$value){
$fenxiaos[] = $value['id'];
$this->getDown($fenxiaos,$value['id']);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment