也许我需要对搜索模型进行更改? 查看索引文件:
<?=
GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' =>
[
//'address'
[
'label' => 'address',
'value' => function($model)
{
return
$model->payment_method.' '.
$model->payment_address_1.' '.
$model->payment_address_2.' '.
$model->payment_city.' '.
$model->payment_postcode.' '.
$model->payment_country.' '.
$model->payment_zone.' ';
},
],
]
?>
&#13;
答案 0 :(得分:0)
您只需在搜索模型中添加:
public function search($params)
{
......
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort'=> ['defaultOrder' => ['your_column_name'=>SORT_DESC]],
]);
......
}