cakephp:在执行2个查询后分页

cakephp:在执行2个查询后分页,php,cakephp,pagination,paginator,Php,Cakephp,Pagination,Paginator,执行2次查询后如何分页 我有: $this->Paginator->settings = array( 'conditions' => array('Record.status =' => 'published', 'RecordUser.flagged =' => null,

执行2次查询后如何分页

我有:

   $this->Paginator->settings = array(
                'conditions' => array('Record.status =' => 'published',  
                                              'RecordUser.flagged =' => null, 
                              'Record.category_id =' => $likes
                                ),
                'limit' => 5,
                'order' => array('rate' => 'desc')
            );
我也想这样做:

$this->Paginator->settings = array(
                'conditions' => array('Record.status =' => 'published',  
                                              'RecordUser.flagged =' => null, 
                              'Record.category_id !=' => $likes
                                ),
                'limit' => 5,
                'order' => array('rate' => 'desc')
            );
然后合并结果。。 问题是第一次查询的结果限制为5,然后继续到第二页。我希望在显示第二个查询的结果之前显示第一个查询的所有结果

我该怎么做?
我正在使用cakephp 2.4.3

为什么您不能只进行一次查询并使用order by

$likes = implode(',', $likes);

$this->YourModel->virtualFields['in_like'] = "IF(Record.category_id IN ($likes), 0, 1)";

$this->Paginator->settings = array(
    'conditions' => array(
        'Record.status =' => 'published',  
        'RecordUser.flagged =' => null, 
     ),
     'limit' => 10,
     'order' => array('in_like' => 'asc', 'rate' => 'desc')
);

我需要在其他记录(第二次查询)显示之前,将$likes中的那些显示在顶部。因此,请解释$like数组like$likes如何包含类别表中的值(category_id),以及它如何包含字符串(category表中没有其他$likes),那么category_id如何可以是字符串?它必须是一个id。你必须清除数组中不是id的字符串。找到它。字符串需要单引号。我怎么能忘记呢?哈哈。谢谢你的帮助!:)