From 7913794001c19d701d9af8c1eddcb2c20ab7cc29 Mon Sep 17 00:00:00 2001 From: vova Date: Wed, 11 May 2022 16:14:55 +0300 Subject: [PATCH] fix product modal --- common/models/ProductLang.php | 2 +- frontend/controllers/SiteController.php | 4 ++-- frontend/views/site/_product.php | 20 +++++++++++++++----- frontend/views/site/index.php | 2 -- frontend/web/js/product.js | 36 +++++++++++++++++++++--------------- 5 files changed, 39 insertions(+), 25 deletions(-) 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 @@ +
\ 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"> - - Получить консультацию