diff --git a/common/config/main.php b/common/config/main.php index 0b034e2..d967c04 100755 --- a/common/config/main.php +++ b/common/config/main.php @@ -9,7 +9,7 @@ return [ ], 'components' => [ 'cache' => [ - 'class' => 'yii\caching\MemCache', + 'class' => 'yii\caching\DummyCache', 'keyPrefix' => 'linija_' ], 'sms' => [ diff --git a/frontend/models/ProductFrontendSearch.php b/frontend/models/ProductFrontendSearch.php index 99b44d2..4e462c8 100755 --- a/frontend/models/ProductFrontendSearch.php +++ b/frontend/models/ProductFrontendSearch.php @@ -71,7 +71,7 @@ 'pageSize' => 15, ], 'sort' => [ - 'attributes' => [ + 'attributes' => [ 'name' => [ 'asc' => [ 'name' => SORT_ASC ], 'desc' => [ 'name' => SORT_DESC ], @@ -85,6 +85,9 @@ 'label' => 'по цене', ], ], + 'defaultOrder' => [ + 'price' => SORT_ASC, + ], ], ] ); @@ -115,10 +118,12 @@ ); // $query->groupBy(['product.product_id', 'product_variant.price', 'product_variant.stock']); - $query->orderBy([ - 'brand.sort' => SORT_ASC, - 'product_variant.stock' => SORT_DESC, - ]); + $query->orderBy( + [ + 'brand.sort' => SORT_ASC, + 'product_variant.stock' => SORT_DESC, + ] + ); ProductHelper::_setQueryParams($query, $params); if ($in_stock) { $query->andWhere( @@ -143,7 +148,8 @@ ->innerJoin( 'event', 'event.event_id=events_to_products.event_id' - )->where(['event.sale' => true]), + ) + ->where([ 'event.sale' => true ]), ], ] ); -- libgit2 0.21.4