public function index() { $id = $_GET['id']; $cate = M('cate')->order('sort')->select(); import('Class.Category', APP_PATH); $cid = Category::getChild($cate, $id); $cid[] = $id; //根据视图模型查找所有的文章 $where = array('sortid' => array('IN', $cid)); $count = M('user')->where($where)->count(); import('ORG.Util.Page'); $page = new Page($count, C('CATE_LIST_NUMS')); $limit = $page->firstRow . ',' . $page->listRows; $blog_list = D('BlogView')->getAll($where, $limit); //查找出上级分类 $cid = $blog_list[0]['cid']; import('Class.Category', APP_PATH); $cate = M('cate')->order('sort')->select(); $this->parentl = Category::getParent($cate, $cid); $this->page = $page->show(); $this->blog_list = $blog_list; $this->display(); }