thinkphp3.2.3 視圖模型實例化後報錯問題
███
███ 2018-04-17 17:19:02
0
2
990
<?php
namespace Admin\Controller;
use Think\Controller;
class ArticleController extends Controller {
    public function lst(){
        $article = D('ArticleView');
        $count = $article->count();// 查询满足要求的总记录数
        $Page = new \Think\Page($count,5);// 实例化分页类 传入总记录数和每页显示的记录数
        $show = $Page->show();// 分页显示输出
        $list = $article->order('id asc')->limit($Page->firstRow.','.$Page->listRows)->select();
        $this->assign('list',$list);// 赋值数据集
        $this->assign('page',$show);// 赋值分页输出
        $this->display();
    }
<?php
namespace Admin\Model;
use Think\Model\ViewModel;
class ArticlViewModel extends ViewModel {
    
}

報錯

1146:表 'tk_blog.blog_article_view' 不存在 [ SQL 語句 ] : SHOW COLUMNS FROM `blog_article_view`


############################################################################################################################################################################################################################
███
███

全部回覆(2)
dabour

表tk_blog.blog_article_view不存在

路过

你這是sql錯誤,跟模版沒關係

#
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!