给data组装二级

    1. // 查询菜单表的一级数据
    2. $data = Db::table('tp_menus')->where([
    3. 'module'=>'admin',
    4. 'fid' =>0
    5. ])->select();
    6. foreach($data as $k => $v){
    7. // 循环一级数据 查询二级数据
    8. $erji = Db::table('tp_menus')->where([
    9. 'module'=>'admin',
    10. 'fid' =>$v['id']
    11. ])->select();
    12. $data[$k]['erji'] = $erji;
    13. }