diff options
author | Camil Staps | 2015-12-17 12:34:20 +0000 |
---|---|---|
committer | Camil Staps | 2015-12-17 12:34:20 +0000 |
commit | b9ecd4fbcd1711b310731f3ee6033722495eabd9 (patch) | |
tree | d7302ad227a985cbe3fd6cbd1785e3c9ff9ee388 /include/home.php | |
parent | Fix deleting offers (diff) |
Fixed a bug where some offers aren't shown in active offers if they have similar attributes
Diffstat (limited to 'include/home.php')
-rw-r--r-- | include/home.php | 4 |
1 files changed, 3 insertions, 1 deletions
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(), |