cqp 1 месяц назад
Родитель
Сommit
03fcfeeca3
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      app/Service/StatisticService.php

+ 2 - 2
app/Service/StatisticService.php

@@ -972,8 +972,8 @@ class StatisticService extends StatisticCommonService
             $return = $this->getYearRangeInfo($data['year']);
             if (is_null($return)) return [false, '年度格式错误'];
             list($month_start, $month_end) = $return;
-            $model->where("start_time", ">=", $month_start)
-                ->where("end_time", "<=", $month_end);
+            $model->where("start_time", "<", strtotime($month_end)) // 项目开始得比月份结束早
+            ->where("end_time", ">", strtotime($month_start)); // 项目结束得比月份开始晚
         }
 
         $list = $model->get()->toArray();