This commit is contained in:
merdan 2024-01-30 15:20:49 +05:00
parent 1159060f78
commit 093765c26c
1 changed files with 7 additions and 7 deletions

View File

@ -15,8 +15,8 @@ class ProductFlatRepository extends WPFRepository
public function getDiscountedProducts($count = 4){
return $this->where('locale', app()->getLocale())
->where('channel', core()->getCurrentChannelCode())
->whereNotNull('special_price')
->whereNotNull('special_price_to')
->whereNotNull('product_flat.special_price')
->whereNotNull('product_flat.special_price_to')
->limit($count)
->inRandomOrder()
->get();
@ -25,11 +25,11 @@ class ProductFlatRepository extends WPFRepository
public function weeklyOffers($count = 8){
return $this->where('locale', app()->getLocale())
->where('channel', core()->getCurrentChannelCode())
->whereNotNull('special_price')
->whereNotNull('special_price_to')
->whereNotNull('special_price_from')
->whereDate('special_price_from','<=',Carbon::today())
->whereDate('special_price_to','>=',Carbon::today())
->whereNotNull('product_flat.special_price')
->whereNotNull('product_flat.special_price_to')
->whereNotNull('product_flat.special_price_from')
->whereDate('product_flat.special_price_from','<=',Carbon::today())
->whereDate('product_flat.special_price_to','>=',Carbon::today())
->limit($count)
->inRandomOrder()
->get();