From adbd41190c0b19a5d2da99381a06cb3658244860 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Sun, 27 Nov 2016 13:53:44 +0200 Subject: [PATCH] 14.09.16 --- common/modules/product/models/Category.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/common/modules/product/models/Category.php b/common/modules/product/models/Category.php index cae96b3..6277c40 100755 --- a/common/modules/product/models/Category.php +++ b/common/modules/product/models/Category.php @@ -252,7 +252,11 @@ class Category extends \yii\db\ActiveRecord ->innerJoin('product', 'product.product_id = product_variant.product_id') ->innerJoin('product_category', 'product_category.product_id = product.product_id') ->innerJoin('tax_value_string', 'tax_value_string.tax_option_id = tax_option.tax_option_id') - ->where(['product_category.category_id' => $this->category_id, 'tax_group.is_filter' => TRUE]) + ->innerJoin('tax_group_to_category', 'tax_group.tax_group_id = tax_group_to_category.tax_group_id') + ->where(['product_category.category_id' => $this->category_id, + 'tax_group.is_filter' => TRUE, + 'tax_group_to_category.category_id'=>$this->category_id, + ]) ->andWhere(['!=', 'product_variant.stock', 0]); $query2 = (new Query()) @@ -267,7 +271,11 @@ class Category extends \yii\db\ActiveRecord ->innerJoin('product_category', 'product_category.product_id = product.product_id') ->innerJoin('product_variant', 'product_variant.product_id = product.product_id') ->innerJoin('tax_value_string', 'tax_value_string.tax_option_id = tax_option.tax_option_id') - ->where(['product_category.category_id' => $this->category_id, 'tax_group.is_filter' => TRUE]) + ->innerJoin('tax_group_to_category', 'tax_group.tax_group_id = tax_group_to_category.tax_group_id') + ->where(['product_category.category_id' => $this->category_id, + 'tax_group.is_filter' => TRUE, + 'tax_group_to_category.category_id'=>$this->category_id, + ]) ->andWhere(['!=', 'product_variant.stock', 0]); $query3 = (new Query()) ->select([ -- libgit2 0.21.4