选择 myTable.*、otherTable.foo、otherTable.bar...
我们如何在 cakephp 中编写上述查询?我试过这个,但没有用。
$data = $this->Articles->find()->select(['Articles.*','Categories.name'])->innerJoineWith('Categories');
它让我在SELECT Fees.* AS
费用附近出错__*.
因此,我必须编写文章表的所有列,而不是那样做。
$data = $this->Articles->find()->select(['Articles.id','Articles.name','Articles.title','Articles.description','Categories.name'])->innerJoineWith('Categories');
cakephp 中有什么解决方案吗?请告诉我。谢谢你。
$data = $this->Articles->find()
->select($this->Articles)
->select(['Categories.name'])
->innerJoineWith('Categories');
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句