Last active
April 1, 2017 09:37
-
-
Save phpdever/0073d5d99d97e23741011e52fd06e950 to your computer and use it in GitHub Desktop.
获取用户关系树
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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