where(['uid' => get_login_admin('id')])->column('group_id'); $adminMenu = Db::name('AdminGroup')->where('id', 'in', $adminGroup)->column('rules'); $adminMenus = []; foreach ($adminMenu as $k => $v) { $v = explode(',', $v); $adminMenus = array_merge($adminMenus, $v); } $menu = Db::name('AdminRule')->where(['menu' => 1,'status'=>1])->where('id', 'in', $adminMenus)->order('sort asc')->select()->toArray(); $list = list_to_tree($menu); \think\facade\Cache::tag('adminMenu')->set('menu' . $admin['id'], $list); } View::assign('menu', $list); return View(); } public function main() { $adminCount = Db::name('Admin')->where('status', '1')->count(); $userCount = Db::name('User')->where('status', '1')->count(); $articleCount = Db::name('Article')->where('status', '1')->count(); $install = false; if (file_exists(CMS_ROOT . 'app/install')) { $install = true; } View::assign('adminCount', $adminCount); View::assign('userCount', $userCount); View::assign('articleCount', $articleCount); View::assign('install', $install); return View(); } public function errorShow() { echo '错误'; } }