public function getTree($list,$pid = 0,$level = 1)
{
$data = [];
foreach ($list as $k => $v) {
if ($v['pid'] == $pid) {
$v['level'] = $level;
$v['children'] = $this->getTree($list,$v['id'],($level + 1));
$data[] = $v;
}
}
return $data;
}
555