我正在使用 cakePHP 1.26。我正在尝试按 DESC 顺序按日期对数据进行排序,但没有运气。
$this->set('posts', $this->Post->findAllByZero('0', array('order'=>array('Post.createdate DESC'))));
如上所示,我无法弄清楚代码中有什么问题。请问你能帮帮我吗?
编辑原因:
我已经更改了代码,它能够按 DESC 顺序按日期对数据进行排序,
但我不确定是否有最好的方法:
$this->set('posts', $this->Site1->find('all', array('conditions'=>array('Post.zero'=>'0'), 'order'=>array('Post.created DESC'))));