当我使用“分组依据”查询时,分页没有显示..只有第一页显示... 如果有人为此提供解决方案,请发布示例..提前致谢
答案 0 :(得分: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')
)
);
}