您好,我需要按 id DESC 对 cgridview 数据表进行排序,我该怎么做?
我的错误代码:
public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('ID',$this->ID);
$criteria->compare('name',$this->name,true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
'sort'=>array(
'ID'=>array(
'desc'=>'ID DESC',
),
),
));
}