Yii Criteria条件在查询语法中排序

时间:2013-11-05 17:12:19

标签: yii yii-extensions yii-components

我有下面的代码,我试图添加'order' => 'creation_date DESC'或类似的东西,但我不能得到正确的sintax(我试图按DESC顺序排序结果);

$criteria = new CDbCriteria;
        $total = EmployerContract::model()->count();

        $pages = new CPagination($total);
        $pages->pageSize = 10;
        $pages->applyLimit($criteria);

        $posts = EmployerContract::model()->findAll($criteria);

0 个答案:

没有答案