|
|
|
|
@ -590,57 +590,33 @@ class OtherController extends CommonController
|
|
|
|
|
$data[] = array_merge($companyInfo, [
|
|
|
|
|
'user_name' => '',
|
|
|
|
|
'course_name' => '',
|
|
|
|
|
'course_type' => '',
|
|
|
|
|
]);
|
|
|
|
|
} else {
|
|
|
|
|
// 每个学员的每个课程一行,格式为"课程名称-课程体系"
|
|
|
|
|
// 每个学员一行,多个课程合并显示
|
|
|
|
|
$isFirstRow = true;
|
|
|
|
|
foreach ($users as $userInfo) {
|
|
|
|
|
$courses = $userInfo['courses'] ?? [];
|
|
|
|
|
|
|
|
|
|
if (empty($courses)) {
|
|
|
|
|
// 如果学员没有课程,仍然导出学员基本信息
|
|
|
|
|
if ($isFirstRow) {
|
|
|
|
|
// 第一行:显示公司信息
|
|
|
|
|
$data[] = array_merge($companyInfo, [
|
|
|
|
|
'user_name' => $userInfo['user_name'] ?? '',
|
|
|
|
|
'course_name' => '',
|
|
|
|
|
]);
|
|
|
|
|
$isFirstRow = false;
|
|
|
|
|
} else {
|
|
|
|
|
// 后续行:公司信息为空
|
|
|
|
|
$data[] = [
|
|
|
|
|
'company_name' => '',
|
|
|
|
|
'company_legal_representative' => '',
|
|
|
|
|
'company_date' => '',
|
|
|
|
|
'stock_date' => '',
|
|
|
|
|
'company_address' => '',
|
|
|
|
|
'company_city' => '',
|
|
|
|
|
'company_area' => '',
|
|
|
|
|
'company_tag' => '',
|
|
|
|
|
'user_name' => $userInfo['user_name'] ?? '',
|
|
|
|
|
'course_name' => '',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// 每个课程一行,格式为"课程名称-课程体系"
|
|
|
|
|
foreach ($courses as $courseIndex => $courseInfo) {
|
|
|
|
|
$courseName = $courseInfo['course_name'] ?? '';
|
|
|
|
|
// 合并同一学员的多个课程:格式为"课程体系-课程名称,课程体系-课程名称"
|
|
|
|
|
$courseList = [];
|
|
|
|
|
foreach ($courses as $courseInfo) {
|
|
|
|
|
$courseType = $courseInfo['course_type'] ?? '';
|
|
|
|
|
|
|
|
|
|
// 格式:课程名称-课程体系
|
|
|
|
|
if ($courseName && $courseType) {
|
|
|
|
|
$courseDisplay = $courseName . '-' . $courseType;
|
|
|
|
|
$courseName = $courseInfo['course_name'] ?? '';
|
|
|
|
|
if ($courseType && $courseName) {
|
|
|
|
|
$courseList[] = $courseType . '-' . $courseName;
|
|
|
|
|
} elseif ($courseName) {
|
|
|
|
|
$courseDisplay = $courseName;
|
|
|
|
|
} else {
|
|
|
|
|
$courseDisplay = '';
|
|
|
|
|
$courseList[] = $courseName;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$courseDisplay = implode("\r\n", $courseList);
|
|
|
|
|
|
|
|
|
|
if ($isFirstRow && $courseIndex === 0) {
|
|
|
|
|
if ($isFirstRow) {
|
|
|
|
|
// 第一行:显示公司信息
|
|
|
|
|
$data[] = array_merge($companyInfo, [
|
|
|
|
|
'user_name' => $userInfo['user_name'] ?? '',
|
|
|
|
|
'course_name' => $courseDisplay,
|
|
|
|
|
'course_type' => '', // 课程类型已合并到课程名称中
|
|
|
|
|
]);
|
|
|
|
|
$isFirstRow = false;
|
|
|
|
|
} else {
|
|
|
|
|
@ -661,8 +637,6 @@ class OtherController extends CommonController
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$fields = [
|
|
|
|
|
'company_name' => '企业名称',
|
|
|
|
|
'company_legal_representative' => '法人',
|
|
|
|
|
|