gogs 1 сар өмнө
parent
commit
eb26c305c8

+ 8 - 4
app/Service/Statistic/StatisticCommonService.php

@@ -403,10 +403,14 @@ class StatisticCommonService extends Service
                 if($v['type'] == "hour") $current_hours = round($item[$v['key']] / 60, 2);
                 if($v['type'] == "hour") $current_hours = round($item[$v['key']] / 60, 2);
                 elseif($v['type'] == "money") $current_hours = round($item[$v['key']] / 100, 2);
                 elseif($v['type'] == "money") $current_hours = round($item[$v['key']] / 100, 2);
                 else $current_hours = $item[$v['key']];
                 else $current_hours = $item[$v['key']];
-                $item[$v['value']] = $current_hours;
-
-                if($v['type'] == "100b") $sum[$k][$key] -= $current_hours ;
-                else $sum[$k][$key] -= $current_hours * 100;
+                if($v['type'] == "100b") {
+                    $sum[$k][$key] -= $current_hours ;
+                    $item[$v['value']] = $current_hours/100;
+                }
+                else{
+                    $sum[$k][$key] -= $current_hours * 100;
+                    $item[$v['value']] = $current_hours;
+                }
             } else {
             } else {
                 if($v['type'] == "day")   $item[$v['value']] = $sum[$k][$key];
                 if($v['type'] == "day")   $item[$v['value']] = $sum[$k][$key];
                 else $item[$v['value']] = round($sum[$k][$key] / 100, 2);
                 else $item[$v['value']] = round($sum[$k][$key] / 100, 2);

+ 1 - 1
app/Service/StatisticService.php

@@ -204,7 +204,7 @@ class StatisticService extends StatisticCommonService
             $item['item_title'] = $item_title_key_list[$item['item_id']] ?? "未知项目({$item['item_id']})";
             $item['item_title'] = $item_title_key_list[$item['item_id']] ?? "未知项目({$item['item_id']})";
             $item['item_code'] = $item_code_key_list[$item['item_id']] ?? "未知项目({$item['item_id']})";
             $item['item_code'] = $item_code_key_list[$item['item_id']] ?? "未知项目({$item['item_id']})";
             $item['employee_title'] = $employee_key_list[$item['employee_id']] ?? "未知人员({$item['employee_id']})";
             $item['employee_title'] = $employee_key_list[$item['employee_id']] ?? "未知人员({$item['employee_id']})";
-            $item['total_hours'] = round($item['total_work'] / 60);
+            $item['total_hours'] = round($item['work_minutes'] / 60,2);
             $item['total_salary'] = round($item['total_salary'] / 100,2);
             $item['total_salary'] = round($item['total_salary'] / 100,2);
             $key = $item['employee_id'] . '_' . $item['month'];
             $key = $item['employee_id'] . '_' . $item['month'];
 //            // 如果不是最后一条
 //            // 如果不是最后一条