<?php namespace Admin\Controller; use Think\Controller; class ArticleController extends Controller { public function lst(){ $article = D('ArticleView'); $count = $article->count();// 查詢滿足要求的總記錄數(shù) $Page = new \Think\Page($count,5);// 實(shí)例化分頁類 傳入總記錄數(shù)和每頁顯示的記錄數(shù) $show = $Page->show();// 分頁顯示輸出 $list = $article->order('id asc')->limit($Page->firstRow.','.$Page->listRows)->select(); $this->assign('list',$list);// 賦值數(shù)據(jù)集 $this->assign('page',$show);// 賦值分頁輸出 $this->display(); }
<?php namespace Admin\Model; use Think\Model\ViewModel; class ArticlViewModel extends ViewModel { }
報(bào)錯(cuò)
1146:Tabelle 'tk_blog.blog_article_view' existiert nicht [SQL-Anweisungen]: SPALTEN VON ?blog_article_view“ anzeigen