thinkphp 3.2 ビュー モデルで生成された SQL ステートメントで 1267 エラーが表示されます。アドバイスをお願いします~
使用した TP3.2 ビュー モデル クエリ
モデルは次のように記述されています
PicViewModel.class.php
<?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','_as'=>'Picture'),<br /> 'PictureAttachment' =>array('pictureid','pictureurl','creattime','_on'=>'Picture.picToken = PictureAttachment.pictureid','_as'=>'PictureAttachment'),<br /><br /><br /> );<br />}<br />
public function Pic(){<br /> $PicModel =D('PicView'); <br /> $s1= $PicModel->field('picTitle,picCategroy,picAuthor,picPostTime,pictureurl')->order('picPostTime desc')->select();<br /> dump($PicModel->getLastSql());<br /> dump($s1);<br /><br /> }
SELECT Picture.picTitle AS picTitle,Picture.picCategroy AS picCategroy,Picture.picAuthor AS picAuthor,Picture.picPostTime AS picPostTime,PictureAttachment.pictureurl AS pictureurl FROM xxx_picture Picture JOIN xxx_picture_attachment PictureAttachment ON Picture.picToken = PictureAttachment.pictureid ORDER BY Picture.picPostTime desc