瀏覽代碼

fixed schedules pagination

tags/v1.0.0
Robin Thoni 9 年之前
父節點
當前提交
8b870da971
共有 1 個檔案被更改,包括 2 行新增1 行删除
  1. 2
    1
      app/Business/SchedulesBusiness.php

+ 2
- 1
app/Business/SchedulesBusiness.php 查看文件

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…
取消
儲存