fix download buttons and sort order

This commit is contained in:
iIronside 2022-12-09 18:05:14 +03:00
parent 7486334234
commit 38935fddd3
3 changed files with 4 additions and 2 deletions

View File

@ -46,6 +46,7 @@ class DocumentSearch extends Document
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort'=> ['defaultOrder' => ['id' => SORT_DESC]],
]);
$this->load($params);

View File

@ -46,6 +46,7 @@ class DocumentTemplateSearch extends DocumentTemplate
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort'=> ['defaultOrder' => ['id' => SORT_DESC]],
]);
$this->load($params);

View File

@ -38,8 +38,8 @@ $this->params['breadcrumbs'][] = 'Загрузить';
<div>
<p>
<?= Html::a('Скачать pdf', ['download', 'id' => $model->id, 'fileType' => 'docx'], ['class' => 'btn btn-success']) ?>
<?= Html::a('Скачать docx', ['download', 'id' => $model->id, 'fileType' => 'pdf'], ['class' => 'btn btn-success']) ?>
<?= Html::a('Скачать pdf', ['download', 'id' => $model->id, 'fileType' => 'pdf'], ['class' => 'btn btn-success']) ?>
<?= Html::a('Скачать docx', ['download', 'id' => $model->id, 'fileType' => 'docx'], ['class' => 'btn btn-success']) ?>
</p>
</div>
</div>