gogs hace 2 meses
padre
commit
4f18089583
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      app/Service/StatisticService.php

+ 5 - 1
app/Service/StatisticService.php

@@ -239,7 +239,7 @@ class StatisticService extends Service
         }
 
         foreach ($item_month_list as $k => $v) {
-            $item_month_list[$k]['days'] = round($v['work_minutes'] / 8 / 60);
+            $item_month_list[$k]['hours'] = round($v['work_minutes']  / 60);
             unset($item_month_list[$k]['work_minutes']);
         }
         $item_month_list = collect($item_month_list)->sortBy('month')->values()->all();
@@ -370,6 +370,10 @@ class StatisticService extends Service
 
     private function commonRule($data)
     {
+        if(isset($data['time_range'])){
+            $data['month_start'] = $data['time_range'][0] ?? null;
+            $data['month_end'] = $data['time_range'][1] ?? null;
+        }
         if (!isset($data['month_start'])) $month_start = date('Y-01-01');
         else $month_start = date('Y-m-01', strtotime($data['month_start']));
         if (!isset($data['month_end'])) $month_end = date('Y-01-01', strtotime('+1 year', strtotime($month_start)));