执行 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