/** * 文章列表 * @author Saki <*****@*****.**> * @date 2014-5-13上午10:30:51 * @version v1.0.0 */ public function listinfo() { $model = new \Admin\Model\ArticleListModel(); //计算分类总数 $sql = "select count(ctm) as count from (select date_format(ctm,'%Y-%m') as ctm from __PREFIX__article_list group by date_format(ctm,'%Y-%m')) a"; $count = $model->query($sql); //分页显示设置 $Page = new \Think\Page($count[0]['count'], 10); $Page->setConfig('prev', '上一页'); $Page->setConfig('next', '下一页'); $Page->setConfig('theme', '%FIRST% %LINK_PAGE% %END%'); $show = $Page->show(); //分页数据处理 $list = $model->getArticleList_Mon($Page); $this->assign('list', $list); $this->assign('page', $show); $this->display(); }