Преглед на файлове

fixed schedules pagination

tags/v1.0.0
Robin Thoni преди 7 години
родител
ревизия
8b870da971
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2
    1
      app/Business/SchedulesBusiness.php

+ 2
- 1
app/Business/SchedulesBusiness.php Целия файл

@@ -97,9 +97,10 @@ class SchedulesBusiness
97 97
 
98 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 101
             $scheduleDate = Carbon::createFromFormat(static::$timeFormat . " " . static::$dateFormat, $schedules[$i] . " " . $date->toDateString());
102 102
             if ($scheduleDate->gte($date)) {
103
+                --$count;
103 104
                 $schedulesCarbon[] = $scheduleDate;
104 105
             }
105 106
         }

Loading…
Отказ
Запис