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