Cakephp 2.0 cakephp中特定条件的分页

Cakephp 2.0 cakephp中特定条件的分页,cakephp-2.0,Cakephp 2.0,列表总数=100 id为4=50的广告客户列表的数量 分页显示: var $paginate = array( 'limit' => 10, 'order' => array( 'Listing.id' => 'desc' ) ); function admin_view_specific_advertiser($id=null) {

列表总数=100

id为4=50的广告客户列表的数量

分页显示:

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
问题是分页只显示列表数据。我只想对特定广告客户的总记录进行分页(本例中为4)

应该是这样的,

Page 1 of 10, showing 10 records out of 100 total

在分页时添加您的条件

Page 1 of 5, showing 10 records out of 50 total

通过这种方式,您可以在分页中添加条件

谢谢您的重播。但我以前尝试过这种方法。顺便说一下,我得到了我正在搜索的确切答案$this->set('listings',$this->paginate('Listing',array('Listing.advertiser_id={$id}','Listing.deleted=0'));
Page 1 of 5, showing 10 records out of 50 total