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