作者 anyv
1 个管道 的构建 通过 耗费 0 秒

首页

... ... @@ -21,6 +21,24 @@ class IndexController extends HomeBaseController
$data = Db::name('slide_item') -> where('slide_id',3) -> find();
$this -> assign('logo',$data);
$shuju = Db::name('nav_menu') -> select();
$data2 = $this -> daohang($shuju);
dump($data2);die;
}
public function daohang($data,$pid=0){
static $arr = [];
foreach ($data as $key => $value) {
if($value['parent_id'] == $pid){
$arr[] = $value;
$this -> daohang($data,$value['id']);
}
}
return $arr;
}
//首页显示
... ...