浏览代码

fixed schedules pagination

tags/v1.0.0
Robin Thoni 8 年前
父节点
当前提交
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
         }

正在加载...
取消
保存