From b9ecd4fbcd1711b310731f3ee6033722495eabd9 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 17 Dec 2015 12:34:20 +0000 Subject: Fixed a bug where some offers aren't shown in active offers if they have similar attributes --- include/home.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/home.php b/include/home.php index 9d99dac..644f2ae 100644 --- a/include/home.php +++ b/include/home.php @@ -155,7 +155,9 @@ require('header.php'); $percentage = ($total == 0) ? 100 : round($since / $total * 100); // We want to sort on percentage (DESC) and secondly end date (ASC) so start date (DESC) - $list[str_pad($percentage, 3, '0', STR_PAD_LEFT) . $offer->getStartDate()] = array( + $base = str_pad($percentage, 3, '0', STR_PAD_LEFT) . $offer->getStartDate(); + for ($i = 0; isset($list["$base-$i"]); $i++); + $list["$base-$i"] = array( 'start' => $start, 'end' => $end, 'id' => $offer->getId(), -- cgit v1.2.3