var $paginate = array(
'limit' => 10,
'order' => array(
'Listing.id' => 'desc'
)
);
function admin_view_specific_advertiser($id=null) {
...other code...
$this->set('listings', $this->Listing->find('all',array('conditions'=>array('Advertiser.id'=>$id))),$this->paginate());
}
URL:http://www.example.com/admin/listings/view_specific_advertiser/4
总房源= 100
广告商的号码列表,ID为4 = 50
分页显示:
Page 1 of 10, showing 10 records out of 100 total
问题是分页仅显示列表数据。我想仅对该特定广告商的总记录进行分页(在这种情况下为4)。
它应该显示如下,
Page 1 of 5, showing 10 records out of 50 total
答案 0 :(得分:0)
添加条件isn pagination
var $paginate = array(
'limit' => 10,
'conditions'=>array('model.field'=>'value'),
'order' => array(
'Listing.id' => 'desc'
)
);
这样你可以在分页中添加条件