Php 如何从paginate语句中获得不同的值?
我得到了多条记录,只想通过Release.id获得distinct?在这种情况下,您必须在字段中使用Php 如何从paginate语句中获得不同的值?,php,cakephp,cakephp-1.3,cakephp-2.0,Php,Cakephp,Cakephp 1.3,Cakephp 2.0,我得到了多条记录,只想通过Release.id获得distinct?在这种情况下,您必须在字段中使用distinct 紧跟在条件之后数组使用字段类似数组 fields=>array('DISTINCE Release.id'、'field 2'、'field 3'、…等等) $this->Release->recursive = 0; $this->paginate['Release']['joins'] = arr
distinct
紧跟在条件之后
数组使用字段
类似数组
fields=>array('DISTINCE Release.id'、'field 2'、'field 3'、…等等)
$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)');