|
$members 是全部数据
$mid 指定ID 从这向下递归
function get_downline($members,$mid,$level=0){
$arr = array();
foreach ($members as $key => $v) {
if($v['upuserid']==$mid){
$arr[]=$v;
$arr = array_merge($arr,$this -> get_downline($members,$v['id']));
}
}
return $arr;
}
|
|