zen 2016-11-09 22:29:29 1742次浏览 0条回复 0 0 0

表名称为TestModel,已创建名为pagination的分页类,在控制器写了一个test方法,应用分页,运行时出错 代码如下:

public function actionTest()
{
    $testmodel=TestModel::model();
    $cnt=$testmodel->count();
    $per=15;
    $page=new pagination($cnt,$per);
    $sql="select * from TestModel $page->limit";
    $testinfo=$testmodel->findAllBySql($sql);
    $page_list=$page->fpage();
    $this->render('test',array('list'=>$testinfo,'pageb'=>$page_list));
}

运行后错误提录如下图:

P2%8UA70H5.png

    没有找到数据。
您需要登录后才可以回复。登录 | 立即注册