gogs 3 долоо хоног өмнө
parent
commit
c6a83d96d3

+ 9 - 3
app/Service/StatisticService.php

@@ -297,11 +297,17 @@ class StatisticService extends StatisticCommonService
         }
         //第一步确定项目
         $item = Item::TopClear($user, $data);
+//        $item_list = $item->where('del_time', 0)
+//            ->where(function ($query) use ($month_start, $month_end) {
+//                $query->where('start_time', '>=', $month_start)
+//                    ->where('end_time', '<', $month_end);
+//            })->select("code", "title", "start_time", "end_time", "id", "state")->orderby("start_time", "asc")->get()->toArray();
+
         $item_list = $item->where('del_time', 0)
-            ->where(function ($query) use ($month_start, $month_end) {
+            /*->where(function ($query) use ($month_start, $month_end) {
                 $query->where('start_time', '>=', $month_start)
-                    ->where('end_time', '<', $month_end);
-            })->select("code", "title", "start_time", "end_time", "id", "state")->orderby("start_time", "asc")->get()->toArray();
+                    ->orWhere('end_time', '<', $month_end);
+            })*/->where('end_time', '<', $month_end)->where('end_time', '>=', $month_start)->select("code", "title", "start_time", "end_time", "id", "state")->orderby("start_time", "asc")->get()->toArray();
         $item_key_list = [];
         foreach ($item_list as $v) {
             $item_key_list[$v['id']] = $v;