在yii这个代码适用于默认sorting: $dataProvider = new CActiveDataProvider('article',array( 'sort'=>array( 'defaultOrder'=>'id DESC', ), 如何在yii2中设置默认sorting? 尝试下面的代码,但没有结果: $dataProvider = new ActiveDataProvider([ 'query' => $query, 'sort' => ['defaultOrder'=>'topic_order asc'] ]);