当我使用“group by”查询时,分页没有显示出来..只有第一页显示...如果有人对此有解决方案,请发布示例..提前致谢
问问题
1831 次
1 回答
2
添加 GROUP BY 子句
var $paginate = array(
'MyModel' => array(
'limit' => 20,
'order' => array('week' => 'desc'),
'group' => array('week', 'home_team_id', 'away_team_id')
)
);
或在行动中即时进行
function index() {
$this->paginate = array(
'MyModel' => array(
'limit' => 20,
'order' => array('week' => 'desc'),
'group' => array('week', 'home_team_id', 'away_team_id')
)
);
}
于 2013-03-16T07:27:43.437 回答