$this->Release->recursive = 0;
$this->paginate['Release']['joins'] =
array(
array(
'table' => ' game_potential_amazon_matches',
'alias' => 'PotentialAmazonMatch',
'type' => 'inner',
'conditions' =>
array(
'PotentialAmazonMatch.release_id = Release.id'
)
)
);
$this->set('releases', $this->paginate('Release'));
$this->set('title_for_layout', 'Release with Potential Amazon Matches)');
我正在获取多条记录,并希望通过Release.id获得区分?
答案 0 :(得分:0)
在这种情况下你必须使用DISTINCT in fields
。
在conditions
数组之后使用fields
数组,如
fields => array('DISTINCE Release.id','field 2','field 3',...etc)