サブクエリの使用はうまくいくようです-この小さなトリックで:
$options = array(
'fields' => array('MAX(SubBlog.created)'),
'conditions' => array('SubBlog.user_id = Blog.user_id')
);
$subquery = $this->subquery('all', $options);
$options = array(
'order'=>array($this->alias.'.published' => 'DESC'),
'conditions' => array(
'User.active' => 1,
'Blog.status' => self::STATUS_ACTIVE,
'Blog.published = ' . $subquery
),
'contain' => array('User.username'),
'fields' => array(
'User.id', 'User.username',
'Blog.id', 'Blog.headline', 'Blog.published'
),
'limit' => $limit,
);
return $this->find('all', $options);
subquery()はAppModelメソッドです: https:// github .com / dereuromark / tools / blob / 2.0 / Lib / MyModel.php#L405