thinkphp 3.2 视图模型 查询 出来bool(false) 求解
模型里这么写的
<?php<br />namespace Home\Model;<br />use Think\Model\ViewModel;<br />class PicViewModel extends ViewModel{<br /> public $viewFields =array(<br /> 'picture'=> array('picTitle','picToken','picCategroy','picAuthor','picPostTime','_type'=>'LEFT'),<br /> 'picture_attachment' =>array('pictureid','pictureurl','creattime','_on'=>'picture.picToken = picture_attachment.pictureid'),<br /><br /> );<br />}
public function Pic(){<br /> $PicModel =D('PicView');<br /><br /> dump($PicModel);<br /> $s = $PicModel->select();<br /> dump($s);<br /><br /> }
<br /># PicView 模型初始化,如果该PicView类存在则调用并初始化,如果不存在 ,则根据表名初始化模型<br /> $PicModel =D('PicView');<br /> <br />#输出所有数据 实际执行的SQL语句是<br /># SELECT * FROM PicView<br /> $s = $PicModel->select();<br />