diff --git a/packages/Sarga/Shop/src/Repositories/ProductRepository.php b/packages/Sarga/Shop/src/Repositories/ProductRepository.php index eda818ec0..9ae9c9163 100644 --- a/packages/Sarga/Shop/src/Repositories/ProductRepository.php +++ b/packages/Sarga/Shop/src/Repositories/ProductRepository.php @@ -115,9 +115,9 @@ class ProductRepository extends WProductRepository $qb->where('product_flat.status', 1); } // -// if (is_null(request()->input('visible_individually'))) { -// $qb->where('product_flat.visible_individually', 1); -// } + 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'])); @@ -158,7 +158,7 @@ class ProductRepository extends WProductRepository } //select distinct `product_flat`.* from `product_flat` inner join `product_categories` on `product_categories`.`product_id` = `product_flat`.`product_id` where `product_flat`.`locale` = 'tm' and `product_flat`.`url_key` is not null and `product_categories`.`category_id` in (6) and `product_flat`.`status` = 1 and `product_flat`.`visible_individually` = 1 and `product_flat`.`color` in (24435) group by `product_flat`.`id` order by `product_flat`.`created_at` desc //select distinct `product_flat`.id,`product_flat`.name, `product_flat`.color, `product_flat`.size, `product_flat`.locale, `product_flat`.product_id,`product_flat`.parent_id, `product_flat`.visible_individually,`product_flat`.url_key from `product_flat` left join `product_categories` on `product_categories`.`product_id` = `product_flat`.`product_id` where `product_flat`.`locale` = 'tm' and `product_flat`.`url_key` is not null and `product_categories`.`category_id` in (6) and `product_flat`.`status` = 1 and `product_flat`.`visible_individually` = 1 group by `product_flat`.`id` order by `product_flat`.`created_at` desc limit 10; -//select distinct `product_flat`.id,`product_flat`.name, `product_flat`.color, `product_flat`.size, `product_flat`.locale, `product_flat`.product_id,`product_flat`.parent_id, `product_flat`.visible_individually,`product_flat`.url_key from `product_flat` left join `product_categories` on `product_categories`.`product_id` = `product_flat`.`product_id` inner join `product_flat` as `variants` on `product_flat`.`id` = COALESCE(variants.parent_id, variants.id) left join `product_attribute_values` on `product_attribute_values`.`product_id` = `variants`.`product_id` where `product_flat`.`locale` = 'tm' and `product_categories`.`category_id` in (6,7) and `product_flat`.`status` = 1 and `product_flat`.`visible_individually` = 1 and ((`product_attribute_values`.`attribute_id` = 23 and (find_in_set(24437, product_attribute_values.integer_value)))) group by `variants`.`id`, `product_flat`.`id` having COUNT(*) = 1 limit 100; +//select distinct `product_flat`.id,`product_flat`.name, `product_flat`.color, `product_flat`.size, `product_flat`.product_id,`product_flat`.parent_id, `product_flat`.visible_individually,`product_flat`.url_key from `product_flat` left join `product_categories` on `product_categories`.`product_id` = `product_flat`.`product_id` inner join `product_flat` as `variants` on `product_flat`.`id` = COALESCE(variants.parent_id, variants.id) left join `product_attribute_values` on `product_attribute_values`.`product_id` = `variants`.`product_id` where `product_categories`.`category_id` in (6,7) and `product_flat`.`visible_individually` = 1 and ((`product_attribute_values`.`attribute_id` = 23 and (find_in_set(24437, product_attribute_values.integer_value)))) group by `variants`.`id`, `product_flat`.`id` having COUNT(*) = 1 limit 100; if ($priceFilter = request('price')) { $priceRange = explode(',', $priceFilter);