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