sql2005,使用视图模型,查询语句有错误。

浏览:483 发布日期:2012/10/30
3.1.0 - 普通 - 未处理
        $smodel = $model->switchModel("View",array("viewFields"));
         $viewFields = array(
             'table1'=>array('*'),
             'table2'=>array('pp','_on'=>'table1.pid = table2.pid'),
         );
         $smodel->setProperty("viewFields",$viewFields);
         $list = $smodel->limit($p->firstRow.','.$p->listRows)->order('id DESC')->select();
         echo $smodel->getLastSql();
         exit;
输出的查询语句中的“ORDER BY table1.id DESC”错误,应该是ORDER BY Thinkphp.id DESC才正确。
评论()
后面还有条评论,点击查看>>