[英]Why is CakePHP 1.3 Pagination ignoring my order?
我有一個報告模型,由於使用了$ this-> paginate()來顯示數據,我一生中都無法改變它的順序。 我究竟做錯了什么? 好像我設置的$ paginate變量對調用$ this-> paginate()的下一行沒有任何影響。
$this->Report->recursive = 0;
$paginate = array('order' => array('Report.id' => 'DESC'));
$this->set('reports', $this->paginate());
更新:
我嘗試了幾件事,但都沒有成功。
順序或限制都不會影響$ this-> paginate()的輸出;
嘗試這個..
$this->paginate = array('Report' => array('order' => 'Report.id' => 'DESC'));
替換第二行
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.