diff --git a/application/models/Dayswithqso_model.php b/application/models/Dayswithqso_model.php index 1b1a0423d..cec3619e9 100644 --- a/application/models/Dayswithqso_model.php +++ b/application/models/Dayswithqso_model.php @@ -137,7 +137,11 @@ class Dayswithqso_model extends CI_Model } } - + if ($dateprev == $datecurr) { + $streaks[$i]['highstreak'] = $streak; + $streaks[$i]['endstreak'] = $endstreak->format('Y-m-d'); + $streaks[$i]['beginstreak'] = $endstreak->sub(new DateInterval('P'.($streak-1).'D'))->format('Y-m-d'); + } if (isset($streaks) && is_array($streaks)) { usort($streaks, array($this,'compareStreak')); // Sort array, highest streak first