From 1eaab8b24a27d879f18f0047091c9deb891cbfb3 Mon Sep 17 00:00:00 2001 From: Yarik Date: Fri, 2 Jun 2017 14:01:46 +0300 Subject: [PATCH] Sorting --- frontend/controllers/CategoryController.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/controllers/CategoryController.php b/frontend/controllers/CategoryController.php index fba2f3c..5caef74 100755 --- a/frontend/controllers/CategoryController.php +++ b/frontend/controllers/CategoryController.php @@ -51,7 +51,16 @@ 'pageSize' => 18, ], 'sort' => [ - 'attributes' => [ + 'attributes' => [ + 'relevant' => [ + 'asc' => [ + 'product.id' => SORT_DESC, + ], + 'desc' => [ + 'product.id' => SORT_DESC, + ], + 'label' => \Yii::t('app', 'по умолчанию'), + ], 'title_asc' => [ 'asc' => [ 'product_lang.title' => SORT_ASC, @@ -89,6 +98,9 @@ 'label' => \Yii::t('app', 'по цене по убыванию'), ], ], + 'defaultOrder' => [ + 'relevant' => SORT_DESC, + ], ], ] ); -- libgit2 0.21.4