Commit adbd41190c0b19a5d2da99381a06cb3658244860
1 parent
23ef7292
14.09.16
Showing
1 changed file
with
10 additions
and
2 deletions
Show diff stats
common/modules/product/models/Category.php
@@ -252,7 +252,11 @@ class Category extends \yii\db\ActiveRecord | @@ -252,7 +252,11 @@ class Category extends \yii\db\ActiveRecord | ||
252 | ->innerJoin('product', 'product.product_id = product_variant.product_id') | 252 | ->innerJoin('product', 'product.product_id = product_variant.product_id') |
253 | ->innerJoin('product_category', 'product_category.product_id = product.product_id') | 253 | ->innerJoin('product_category', 'product_category.product_id = product.product_id') |
254 | ->innerJoin('tax_value_string', 'tax_value_string.tax_option_id = tax_option.tax_option_id') | 254 | ->innerJoin('tax_value_string', 'tax_value_string.tax_option_id = tax_option.tax_option_id') |
255 | - ->where(['product_category.category_id' => $this->category_id, 'tax_group.is_filter' => TRUE]) | 255 | + ->innerJoin('tax_group_to_category', 'tax_group.tax_group_id = tax_group_to_category.tax_group_id') |
256 | + ->where(['product_category.category_id' => $this->category_id, | ||
257 | + 'tax_group.is_filter' => TRUE, | ||
258 | + 'tax_group_to_category.category_id'=>$this->category_id, | ||
259 | + ]) | ||
256 | ->andWhere(['!=', 'product_variant.stock', 0]); | 260 | ->andWhere(['!=', 'product_variant.stock', 0]); |
257 | 261 | ||
258 | $query2 = (new Query()) | 262 | $query2 = (new Query()) |
@@ -267,7 +271,11 @@ class Category extends \yii\db\ActiveRecord | @@ -267,7 +271,11 @@ class Category extends \yii\db\ActiveRecord | ||
267 | ->innerJoin('product_category', 'product_category.product_id = product.product_id') | 271 | ->innerJoin('product_category', 'product_category.product_id = product.product_id') |
268 | ->innerJoin('product_variant', 'product_variant.product_id = product.product_id') | 272 | ->innerJoin('product_variant', 'product_variant.product_id = product.product_id') |
269 | ->innerJoin('tax_value_string', 'tax_value_string.tax_option_id = tax_option.tax_option_id') | 273 | ->innerJoin('tax_value_string', 'tax_value_string.tax_option_id = tax_option.tax_option_id') |
270 | - ->where(['product_category.category_id' => $this->category_id, 'tax_group.is_filter' => TRUE]) | 274 | + ->innerJoin('tax_group_to_category', 'tax_group.tax_group_id = tax_group_to_category.tax_group_id') |
275 | + ->where(['product_category.category_id' => $this->category_id, | ||
276 | + 'tax_group.is_filter' => TRUE, | ||
277 | + 'tax_group_to_category.category_id'=>$this->category_id, | ||
278 | + ]) | ||
271 | ->andWhere(['!=', 'product_variant.stock', 0]); | 279 | ->andWhere(['!=', 'product_variant.stock', 0]); |
272 | $query3 = (new Query()) | 280 | $query3 = (new Query()) |
273 | ->select([ | 281 | ->select([ |