|
|
@@ -512,6 +512,9 @@ class ExportFileService extends Service
|
|
|
return date('Y年m月', strtotime($item['order_date']));
|
|
|
});
|
|
|
|
|
|
+ //获取公司基本信息
|
|
|
+ $company = EmployeeService::getCompanyDetail($user);
|
|
|
+
|
|
|
foreach ($groupedByMonth as $monthName => $monthItems) {
|
|
|
// A. 计算该月总天数
|
|
|
// 转换 '2024年04月' 为 '2024-04' 获取天数
|
|
|
@@ -526,9 +529,9 @@ class ExportFileService extends Service
|
|
|
$sheetRows = [];
|
|
|
foreach ($groupedByUserItem as $key => $records) {
|
|
|
$first = $records->first();
|
|
|
- // 初始化行:前两列是 项目编号 和 姓名
|
|
|
+ // 初始化行:前两列是 项目名称 和 姓名
|
|
|
$row = [
|
|
|
- $first['item_code'],
|
|
|
+ $first['item_title'],
|
|
|
$first['employee_name']
|
|
|
];
|
|
|
|
|
|
@@ -549,7 +552,8 @@ class ExportFileService extends Service
|
|
|
|
|
|
$monthsData[$monthName] = [
|
|
|
'days' => (int)$daysInMonth,
|
|
|
- 'data' => $sheetRows
|
|
|
+ 'data' => $sheetRows,
|
|
|
+ 'company_name' => $company['title'] ?? '',
|
|
|
];
|
|
|
}
|
|
|
|