这是我对MySQL的查询:
select u.full_name, c.comment_content from users u, comments WHERE u.user_id=c.user_id
如何在cakephp中使用find()
重写此SQL?
答案 0 :(得分:0)
你走了:
$query = $this->Users
->find()
->select(['full_name', 'comment_content'])
->where(['user_id =' => $cUserID])
->order(['created' => 'DESC']); //extra