Browse Source

fixed schedules pagination

tags/v1.0.0
Robin Thoni 7 years ago
parent
commit
8b870da971
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      app/Business/SchedulesBusiness.php

+ 2
- 1
app/Business/SchedulesBusiness.php View File

97
 
97
 
98
         $schedulesCarbon = [];
98
         $schedulesCarbon = [];
99
 
99
 
100
-        for ($i = 0; $i < min($count, count($schedules)); ++$i) {
100
+        for ($i = 0; $i < count($schedules) && $count > 0; ++$i) {
101
             $scheduleDate = Carbon::createFromFormat(static::$timeFormat . " " . static::$dateFormat, $schedules[$i] . " " . $date->toDateString());
101
             $scheduleDate = Carbon::createFromFormat(static::$timeFormat . " " . static::$dateFormat, $schedules[$i] . " " . $date->toDateString());
102
             if ($scheduleDate->gte($date)) {
102
             if ($scheduleDate->gte($date)) {
103
+                --$count;
103
                 $schedulesCarbon[] = $scheduleDate;
104
                 $schedulesCarbon[] = $scheduleDate;
104
             }
105
             }
105
         }
106
         }

Loading…
Cancel
Save