yii去掉自动排序功能
Yii去掉自动排序功能并自定义排序
public function search($params)
{
$query = SvnManage::find()->addOrderBy([
'created_at' => SORT_DESC // 自定义按创建时间倒序排序
]);
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' => false, // 去掉自动排序功能
]);