
public function newslist($catid){
$db = M("content");
$count = $db->where('catid='.$catid)->count();
$pagecount = 1;
$page = new \Think\Page($count , $pagecount);
$page->parameter = $row;
$page->setConfig('first','首页');
$page->setConfig('prev','上一页');
$page->setConfig('next','下一页');
$page->setConfig('last','尾页');
$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
$show = $page->show();
$list = $db->where('catid='.$catid)->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
$this->assign('list',$list);
$this->assign('page',$show);
$this->display();
}错误路径http://localhost:801/Backstage/Body/newslist/p/1
正确路径
http://localhost:801/index.php/Backstage/Body/newslist/catid/1/p/2
最佳答案