remove lishniy productstan

This commit is contained in:
merdan 2022-05-20 13:10:37 +05:00
parent 51c484df88
commit 519e6ea4b2
1 changed files with 3 additions and 2 deletions

View File

@ -89,13 +89,13 @@ class ProductRepository extends WProductRepository
$qb = $query->distinct()
->select('product_flat.*')
->leftJoin('product_categories', 'product_categories.product_id', '=', 'product_flat.product_id')
->where('product_flat.channel', $channel)
->where('product_flat.locale', $locale)
->whereNotNull('product_flat.url_key');
if ($categoryId) {
$qb->whereIn('product_categories.category_id', explode(',', $categoryId));
$qb->leftJoin('product_categories', 'product_categories.product_id', '=', 'product_flat.product_id')
->whereIn('product_categories.category_id', explode(',', $categoryId));
}
if(isset($params['brand'])) {
@ -118,6 +118,7 @@ class ProductRepository extends WProductRepository
if (is_null(request()->input('visible_individually'))) {
$qb->where('product_flat.visible_individually', 1);
}
if(isset($params['color'])){
$qb->whereIn('product_flat.color', explode(',', $params['color']));
}