我要疯了,试图找到一个好的解决方案,要么使用 theset::extract()
或其他东西。我想在我的可包含项中添加一个 GROUP BY:
$params = array(
'conditions'=>array(
'Project.id'=>$ProjectId
),
'contain'=>array(
//Gets the User Who owns the Project
'User'=>$user,
'Bid'=>array(
//The User Who owns the Bid
'User'=>$user
),
'ProjectType',
'Os',
'Comment'=>array(
'To'=>$user,
'From'=>$user,
'group'=>"Comment.from_id"
),
),
);
//debug($params);
return $this->find('first',$params);
我不想破解这个问题 - 有没有更简单的方法可以做到这一点?