複数のテーブルを示すスクリーンショットに参加しました。すべて同じクエリから発生しているにもかかわらず、ページネーターが複数の「表示された」テーブルを処理するようにしたいと思います。'Id'列は多くの列の1つであることに注意してください。
var $paginate = array(
'limit' => 1000);
function index() {
$this->Immeuble->recursive = 1;
$this->Immeuble->contain('Agence');
$this->set('results', $this->paginate());
$agences = $this->Immeuble->find('count', array('fields' => 'DISTINCT Agence.Nom'));
$this->set('agences',$agences);
$ii = 0;
$records = $this->Immeuble->find("all",array('fields'=>'Immeuble.id,Immeuble.image,Immeuble.description,Immeuble.start_date,Immeuble.end_date$
$this->set('records',$records);
}
ここに私の見解の私のページネーターの部分があります:
<tr>
<th><?php echo $this->Paginator->sort('Id','id'); ?></th>
<th><?php echo $this->Paginator->sort('description');?></th>
<th><?php echo $this->Paginator->sort('start_date');?></th>
<th><?php echo $this->Paginator->sort('end_date');?></th>
<th><?php echo $this->Paginator->sort('image');?></th>
<th><?php echo $this->Paginator->sort('ordre');?></th>
<th><?php echo $this->Paginator->sort('agence_id');?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>