public function detail() { $id = intval($_GET['lid']); $info = M('News')->where(array('id' => $id, 'uid' => 0, 'status' => 1))->find(); if (empty($info)) { $this->error('抱歉,没有找到该文章哦!'); } else { $menu = M('Menu')->where(array('status' => 1))->order('sort DESC')->select(); $info['menu'] = Menu::getParents($menu, $info['menu_id']); $menus = menu::unlimitedForLayer($menu); $this->news = M('News')->where(array('status' => 1))->field(array('id', 'uid', 'title', 'addtime'))->order('asort DESC,addtime DESC')->limit(12)->select(); $this->menu = $menus; $this->info = $info; $this->seo_set($info['title']); $this->display(); } }