时间:2021-07-01 10:21:17 帮助过:6人阅读
array('picTitle','picToken','picCategroy','picAuthor','picPostTime','_as'=>'Picture'), 'PictureAttachment' =>array('pictureid','pictureurl','creattime','_on'=>'Picture.picToken = PictureAttachment.pictureid','_as'=>'PictureAttachment'), );}
public function Pic(){ $PicModel =D('PicView'); $s1= $PicModel->field('picTitle,picCategroy,picAuthor,picPostTime,pictureurl')->order('picPostTime desc')->select(); dump($PicModel->getLastSql()); dump($s1); }
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
贴出表结构看看
贴出表结构看看