无限极分类引用版
function generateTree($data){
$items = array();
foreach($data as $v){
$items[$v['auth_id']] = $v;
}
$tree = array();
foreach($items as $k => $item){
if(isset($items[$item['auth_pid']])){
$items[$item['auth_pid']]['son'][] = &$items[$k];
}else{
$tree[] = &$items[$k];
}
}
return $tree;
}