From e5f77089def6cd65d591d99b362a6a897677ecb1 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 14 Nov 2016 15:50:40 +0200 Subject: [PATCH] full commit --- widgets/Seo.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/widgets/Seo.php b/widgets/Seo.php index 9869ea7..aef370c 100644 --- a/widgets/Seo.php +++ b/widgets/Seo.php @@ -394,19 +394,19 @@ class Seo extends Widget if (isset($filter['brands']) && count($filter['brands']) == 1) { - $model = Brand::find()->where(['alias' => $filter['brands'][0]])->one(); + $model = Brand::find()->joinWith('lang')->where(['alias' => $filter['brands'][0]])->one(); if (!$model instanceof Brand) { \Yii::$app->response->redirect(['/site/error'], 404); } else { $array['brand']['name'] = 'Бренд'; - $array['brand']['value'] = $model->name; + $array['brand']['value'] = $model->lang->title; } } - $optionsList = ArrayHelper::map(TaxGroup::find()->where(['is_filter' => 'TRUE'])->all(), 'alias', 'name'); + $optionsList = ArrayHelper::map(TaxGroup::find()->joinWith('lang')->where(['is_filter' => 'TRUE'])->asArray()->all(), 'alias', 'name'); foreach ($optionsList as $optionList => $name) { @@ -414,12 +414,12 @@ class Seo extends Widget if (isset($filter[$optionList]) && count($filter[$optionList]) == 1) { - $model = TaxOption::find()->where(['alias' => $filter[$optionList]])->one(); + $model = TaxOption::find()->joinWith('lang')->where(['alias' => $filter[$optionList]])->one(); if (!$model instanceof TaxOption) { \Yii::$app->response->redirect(['site/error'], 404); } else { - $array[$optionList]['value'] = $model->value; + $array[$optionList]['value'] = $model->lang->value; $array[$optionList]['name'] = $name; } -- libgit2 0.21.4