|
|
@@ -979,11 +979,11 @@ class StatisticService extends Service
|
|
|
$item_month_list[$item_key] = [
|
|
|
"month" => $item['order_month'],
|
|
|
"allocated_salary" => 0,
|
|
|
- "employee_id" => 0,
|
|
|
+ "employee_id" => $item['employee_id'],
|
|
|
"work_minutes" => 0,
|
|
|
- "salary" => $salary_map[$key]['salary'],
|
|
|
- "social_insurance" => $salary_map[$key]['social_insurance'],
|
|
|
- "public_housing_fund" => $salary_map[$key]['public_housing_fund'],
|
|
|
+ "salary" => $salary_map[$key]['salary'] ?? 0,
|
|
|
+ "social_insurance" => $salary_map[$key]['social_insurance']??0,
|
|
|
+ "public_housing_fund" => $salary_map[$key]['public_housing_fund']??0,
|
|
|
"item_id" => $item['item_id'],
|
|
|
];
|
|
|
}
|
|
|
@@ -996,7 +996,7 @@ class StatisticService extends Service
|
|
|
}else{
|
|
|
$ratio = 0;
|
|
|
}
|
|
|
- $item_month_list[$item_key]['ratio'] = $ratio;
|
|
|
+ $item_month_list[$item_key]['radio'] = $ratio;
|
|
|
$item_month_list[$item_key]['total_min'] = $total_min;
|
|
|
$item_month_list[$item_key]['work_minutes'] += $item['total_work'];
|
|
|
}
|
|
|
@@ -1016,11 +1016,11 @@ class StatisticService extends Service
|
|
|
$item_month_list = collect($item_month_list)->transform(function ($item) use ($item_title_key_list, $item_code_key_list,$employee_key_list) {
|
|
|
$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['employee_title'] = $employee_key_list[$item['employee_id']]['title'] ?? "未知人员({$item['item_id']})";
|
|
|
- $item['major'] = $employee_key_list[$item['employee_id']]['major'] ?? "未知人员({$item['item_id']})";
|
|
|
+ $item['employee_title'] = $employee_key_list[$item['employee_id']]['title'] ?? "未知人员({$item['employee_id']})";
|
|
|
+ $item['major'] = $employee_key_list[$item['employee_id']]['major'] ?? "未知人员({$item['employee_id']})";
|
|
|
$item['total_min'] = round($item['total_min']/60,2);
|
|
|
$item['work_minutes'] = round($item['work_minutes']/60,2);
|
|
|
- $item['work_salary'] = round($item['work_salary']*$item['radio'],2);
|
|
|
+ $item['work_salary'] = round($item['salary']*$item['radio'],2);
|
|
|
$item['work_social_insurance'] = round($item['social_insurance']*$item['radio'],2);
|
|
|
$item['work_public_housing_fund'] = round($item['public_housing_fund']*$item['radio'],2);
|
|
|
return $item;
|