|
|
|
|
@ -471,27 +471,31 @@ class OtherController extends CommonController
|
|
|
|
|
|
|
|
|
|
case 'areas':
|
|
|
|
|
// 区域明细 - 导出course_signs_pass列表数据,附加区域信息
|
|
|
|
|
$courseSigns = CourseSign::courseSignsTotal($start_date, $end_date, 1, $course_ids, null, true);
|
|
|
|
|
$courseSigns = CourseSign::area($start_date, $end_date, 1, $courses->pluck('id'), false);
|
|
|
|
|
// 加载关联关系
|
|
|
|
|
$courseSigns->load(['user', 'course']);
|
|
|
|
|
$courseSigns->load(['user.company', 'course']);
|
|
|
|
|
|
|
|
|
|
foreach ($courseSigns as $sign) {
|
|
|
|
|
$data[] = [
|
|
|
|
|
'area_name' => $sign->user->company_area ?? '',
|
|
|
|
|
'company_name' => $sign->user->company->company_name ?? '',
|
|
|
|
|
'area_name' => $sign->user->company->company_area ?? '',
|
|
|
|
|
'company_city' => $sign->user->company->company_city ?? '',
|
|
|
|
|
'company_province' => $sign->user->company->company_province ?? '',
|
|
|
|
|
'user_name' => $sign->user->name ?? '',
|
|
|
|
|
'mobile' => $sign->user->mobile ?? '',
|
|
|
|
|
'company_name' => $sign->user->company_name ?? '',
|
|
|
|
|
'course_name' => $sign->course->name ?? '',
|
|
|
|
|
'created_at' => $sign->created_at ? $sign->created_at->format('Y-m-d H:i:s') : '',
|
|
|
|
|
// 'created_at' => $sign->created_at ? $sign->created_at->format('Y-m-d H:i:s') : '',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
$fields = [
|
|
|
|
|
'area_name' => '区域名称',
|
|
|
|
|
'company_name' => '企业名称',
|
|
|
|
|
'company_area' => '公司区域',
|
|
|
|
|
'company_city' => '公司城市',
|
|
|
|
|
'company_province' => '公司省份',
|
|
|
|
|
'user_name' => '学员姓名',
|
|
|
|
|
'mobile' => '手机号',
|
|
|
|
|
'company_name' => '企业名称',
|
|
|
|
|
'course_name' => '课程名称',
|
|
|
|
|
'created_at' => '报名时间',
|
|
|
|
|
// 'created_at' => '报名时间',
|
|
|
|
|
];
|
|
|
|
|
$filename = '区域明细';
|
|
|
|
|
break;
|
|
|
|
|
|