Commit e5f77089def6cd65d591d99b362a6a897677ecb1
1 parent
ba782a19
full commit
Showing
1 changed file
with
5 additions
and
5 deletions
Show diff stats
widgets/Seo.php
| @@ -394,19 +394,19 @@ class Seo extends Widget | @@ -394,19 +394,19 @@ class Seo extends Widget | ||
| 394 | 394 | ||
| 395 | 395 | ||
| 396 | if (isset($filter['brands']) && count($filter['brands']) == 1) { | 396 | if (isset($filter['brands']) && count($filter['brands']) == 1) { |
| 397 | - $model = Brand::find()->where(['alias' => $filter['brands'][0]])->one(); | 397 | + $model = Brand::find()->joinWith('lang')->where(['alias' => $filter['brands'][0]])->one(); |
| 398 | if (!$model instanceof Brand) { | 398 | if (!$model instanceof Brand) { |
| 399 | 399 | ||
| 400 | \Yii::$app->response->redirect(['/site/error'], 404); | 400 | \Yii::$app->response->redirect(['/site/error'], 404); |
| 401 | } else { | 401 | } else { |
| 402 | $array['brand']['name'] = 'Бренд'; | 402 | $array['brand']['name'] = 'Бренд'; |
| 403 | - $array['brand']['value'] = $model->name; | 403 | + $array['brand']['value'] = $model->lang->title; |
| 404 | } | 404 | } |
| 405 | 405 | ||
| 406 | } | 406 | } |
| 407 | 407 | ||
| 408 | 408 | ||
| 409 | - $optionsList = ArrayHelper::map(TaxGroup::find()->where(['is_filter' => 'TRUE'])->all(), 'alias', 'name'); | 409 | + $optionsList = ArrayHelper::map(TaxGroup::find()->joinWith('lang')->where(['is_filter' => 'TRUE'])->asArray()->all(), 'alias', 'name'); |
| 410 | 410 | ||
| 411 | 411 | ||
| 412 | foreach ($optionsList as $optionList => $name) { | 412 | foreach ($optionsList as $optionList => $name) { |
| @@ -414,12 +414,12 @@ class Seo extends Widget | @@ -414,12 +414,12 @@ class Seo extends Widget | ||
| 414 | 414 | ||
| 415 | if (isset($filter[$optionList]) && count($filter[$optionList]) == 1) { | 415 | if (isset($filter[$optionList]) && count($filter[$optionList]) == 1) { |
| 416 | 416 | ||
| 417 | - $model = TaxOption::find()->where(['alias' => $filter[$optionList]])->one(); | 417 | + $model = TaxOption::find()->joinWith('lang')->where(['alias' => $filter[$optionList]])->one(); |
| 418 | if (!$model instanceof TaxOption) { | 418 | if (!$model instanceof TaxOption) { |
| 419 | 419 | ||
| 420 | \Yii::$app->response->redirect(['site/error'], 404); | 420 | \Yii::$app->response->redirect(['site/error'], 404); |
| 421 | } else { | 421 | } else { |
| 422 | - $array[$optionList]['value'] = $model->value; | 422 | + $array[$optionList]['value'] = $model->lang->value; |
| 423 | $array[$optionList]['name'] = $name; | 423 | $array[$optionList]['name'] = $name; |
| 424 | } | 424 | } |
| 425 | 425 |