diff --git a/common/models/ProductLang.php b/common/models/ProductLang.php index c198987..1b41eff 100644 --- a/common/models/ProductLang.php +++ b/common/models/ProductLang.php @@ -57,7 +57,7 @@ class ProductLang extends ActiveRecord 'targetAttribute' => [ 'language_id' => 'id' ], ], [ - [ 'tile_id' ], + [ 'product_id' ], 'exist', 'skipOnError' => true, 'targetClass' => Product::className(), diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index ecb9de2..8ffcc6f 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -102,8 +102,8 @@ ->orderBy('id') ->limit(4) ->all(); - $productsCompany = Product::find()->where(['!=','type',Product::TYPE_PRIVATE])->all(); - $productsPrivate = Product::find()->where(['!=','type',Product::TYPE_COMPANY])->all(); + $productsCompany = Product::find()->with(['lang', 'image'])->where(['!=','type',Product::TYPE_PRIVATE])->all(); + $productsPrivate = Product::find()->with(['lang', 'image'])->where(['!=','type',Product::TYPE_COMPANY])->all(); return $this->render( 'index', [ diff --git a/frontend/views/site/_product.php b/frontend/views/site/_product.php index a940eb1..64a86ef 100644 --- a/frontend/views/site/_product.php +++ b/frontend/views/site/_product.php @@ -1,11 +1,21 @@ +
- + - + image->getImg([]) ?> - Промышленная солнечная электростанция 2 МВт - "Под ключ" -
1740000.00 $
+ + lang->title ?> + +
price ?> $
\ No newline at end of file diff --git a/frontend/views/site/index.php b/frontend/views/site/index.php index 6a7e1e0..f4aeab7 100755 --- a/frontend/views/site/index.php +++ b/frontend/views/site/index.php @@ -550,8 +550,6 @@ $coordinates['lon'] = empty($settings->lon) ? 0 : $settings->lon; width="100%" height="380" style="border:0;" allowfullscreen="" loading="lazy"> - - Получить консультацию