Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Bozhidar Slaveykov committed Oct 27, 2021
1 parent 0b11586 commit 5f16ffd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/MicroweberPackages/Offer/Repositories/OfferRepository.php
Expand Up @@ -89,22 +89,22 @@ public function getProductIdsThatHaveOfferPrice()
{
return $this->cacheCallback(__FUNCTION__, func_get_args(), function () {

$result = [];
$productIds = [];

$getOffers = \DB::table('offers')
->select('product_id')
->groupBy('product_id')
->get();

if ($getOffers->count() > 0) {
$result = $getOffers->toArray();
$result = array_values($result);
$result = array_flatten($result);
// $result = array_flip($result);
$result = array_keys($result);
foreach ($getOffers as $offer) {
if ($offer->product_id > 0) {
$productIds[] = $offer->product_id;
}
}
}

return $result;
return $productIds;
});
}

Expand Down

0 comments on commit 5f16ffd

Please sign in to comment.