From 3783dbd96cb5df8640591ff38cc3e29f728c6c99 Mon Sep 17 00:00:00 2001 From: merdan Date: Sat, 17 Dec 2022 16:52:20 +0500 Subject: [PATCH] cache responces achyklar --- .../Sarga/Shop/src/Repositories/ProductRepository.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/Sarga/Shop/src/Repositories/ProductRepository.php b/packages/Sarga/Shop/src/Repositories/ProductRepository.php index 0fe6260b3..512ac4ad6 100644 --- a/packages/Sarga/Shop/src/Repositories/ProductRepository.php +++ b/packages/Sarga/Shop/src/Repositories/ProductRepository.php @@ -94,7 +94,7 @@ class ProductRepository extends WProductRepository // ->whereNotNull('product_flat.url_key'); if ($categoryId) { - $qb->leftJoin('product_categories', 'product_categories.product_id', '=', 'product_flat.product_id') + $qb->join('product_categories', 'product_categories.product_id', '=', 'product_flat.product_id') ->whereIn('product_categories.category_id', explode(',', $categoryId)); } @@ -106,7 +106,9 @@ class ProductRepository extends WProductRepository $qb->whereIn('product_flat.cinsiyet', explode(',', $params['cinsiyet'])); } - + if(isset($params['discount']) && $params['discount']){ + $qb->where('product_flat.special_price','>',0); + } if (! core()->getConfigData('catalog.products.homepage.out_of_stock_items')) { $qb = $this->checkOutOfStockItem($qb); @@ -238,9 +240,7 @@ class ProductRepository extends WProductRepository }); # apply scope query so we can fetch the raw sql and perform a count - if(isset($params['discount']) && $params['discount']){ - $repository->where('product_flat.special_price','>',0); - } + $repository->applyScope();