为什么CakePHP 1.3分页会忽略我的订单?
我有一个报表模型,我一生都无法让它更改顺序,因为在显示数据时使用了$this->paginate()。我做错了什么?好像我设置的$paginate变量对调用$this->paginate()的下一行没有任何影响为什么CakePHP 1.3分页会忽略我的订单?,cakephp,paginate,Cakephp,Paginate,我有一个报表模型,我一生都无法让它更改顺序,因为在显示数据时使用了$this->paginate()。我做错了什么?好像我设置的$paginate变量对调用$this->paginate()的下一行没有任何影响 $this->Report->recursive = 0; $paginate = array('order' => array('Report.id' => 'DESC')); $this->set('reports', $this->paginat
$this->Report->recursive = 0;
$paginate = array('order' => array('Report.id' => 'DESC'));
$this->set('reports', $this->paginate());
更新:
我又尝试了几件事,但都没有成功
$this->paginate = array('Report' => array('order' => 'Report.id' => 'DESC'));
更换您的第二行您的初始设置在我看来很好。。。总是这样为我工作!陛下