Порядок вывода данных в таблице GridView по дате создания YII2

Есть сайт с CMS реализованной на yii2. В панели администратора есть раздел "клиенты", со списком клиентов и возможность редактирования каждого клиента. Данные об аккаунтах клиентов имеют дату создания и сейчас по дефолту сначала выводятся старые клиенты. Так вот, к вопросу - подскажите пожалуйста как изменить порядок вывода записей, таким образом, чтобы сначала выводились не старые клиенты, а новые? ps. таблица выводится с помощью виджета GridView.

        <?= GridView::widget([
            'id' => 'customers',
            'tableOptions' => [
                'class' => 'table table-bordered table-hover table-striped',
            ],
            'options'          => ['class' => 'table-responsive grid-view'],
            'dataProvider' => $dataProvider,
            'filterModel' => $searchModel,
            'columns' => [
                'first_name',
                'last_name',
                'email',
                'source',
                'adsCount',
                [
                 'attribute'=>'created_at',
                 'filter'=>  DatePicker::widget(
                     [
                        'model' => $searchModel,
                        'attribute' => 'created_at',
                        'options'=>[
                            'class'=>'form-control',
                            ],
                        'dateFormat' => 'yyyy-MM-dd',
                     ]
                 )
                ],
                [
                 'attribute'=>'status',
                 'value'=> function($model) {
                     return t('app',ucfirst(html_encode($model->status)));
                 },
                 'filter' => Html::activeDropDownList($searchModel, 'status', [ 'active' => t('app','Active'), 'inactive' => t('app','Inactive') ],['class'=>'form-control','prompt' => 'All'])
                ],
                [
                    'class' => 'yii\grid\ActionColumn',
                    'contentOptions' => [
                        'class'=>'table-actions',
                        'id' => 'table-action-customer'
                    ],
                    'template' => '{activation} {activate} {deactivate} {impersonate} {view} {update} {delete}',
                    'buttons'  => [
                        'activation' => function ($url, $model) {
                            return ($model->status === \app\models\Customer::STATUS_INACTIVE && $model->activation_key != null) ? Html::a(
                                '<span class="fa fa-envelope-o"></span>',
                                $url,
                                [
                                    'data-content'      => t('app', 'Resend the activation email.'),
                                    'data-container'    => 'body',
                                    'data-toggle'       => 'popover',
                                    'data-trigger'      => 'hover',
                                    'data-placement'    => 'top',
                                    'data-pjax'         => '0',
                                    'data-confirm'      => t('app', 'Are you sure you want to resend the activation email for this customer?'),
                                    'style'             => 'margin-right: 7px'
                                ]
                            ) : '';
                        },
                        'activate' => function ($url, $model) {
                            return ($model->status === \app\models\Customer::STATUS_INACTIVE || $model->status === \app\models\Customer::STATUS_DEACTIVATED) ? Html::a(
                                '<span class="fa fa-check"></span>',
                                $url,
                                [
                                    'data-content'      => t('app', 'Set active'),
                                    'data-container'    => 'body',
                                    'data-toggle'       => 'popover',
                                    'data-trigger'      => 'hover',
                                    'data-placement'    => 'top',
                                    'data-confirm'      => t('app', 'Are you sure you want to activate this customer?'),
                                    'style'             => 'margin-right: 6px'
                                ]
                            ) : '';
                        },
                        'deactivate' => function ($url, $model) {
                            return $model->status === \app\models\Customer::STATUS_ACTIVE ? Html::a(
                                '<span class="fa fa-times"></span>',
                                $url,
                                [
                                    'data-content'      => t('app', 'Set deactivated'),
                                    'data-container'    => 'body',
                                    'data-toggle'       => 'popover',
                                    'data-trigger'      => 'hover',
                                    'data-placement'    => 'top',
                                    'data-pjax'         => '0',
                                    'data-confirm'      => t('app', 'Are you sure you want to deactivate this customer?'),
                                    'style'             => 'margin-right: 9px'
                                ]
                            ) : '';
                        },
                        'impersonate' => function ($url, $model) {
                            return Html::a(
                                '<i class="fa fa-random"></i>',
                                url(['/admin/customers/impersonate', 'id' => $model->customer_id]),
                                [
                                    'data-content'      => t('app', 'Impersonate this customer account on frontend'),
                                    'data-container'    => 'body',
                                    'data-toggle'       => 'popover',
                                    'data-trigger'      => 'hover',
                                    'data-placement'    => 'top',
                                    'data-pjax' => '0',
                                    'style'     => 'margin-right: 5px'
                                ]
                            );
                        },
                    ],
                ],
            ],
        ]); ?>

Ответы (0 шт):