|
|
|
|
@ -598,8 +598,18 @@ class CourseSign extends SoftDeletesModel
|
|
|
|
|
// 返回列表
|
|
|
|
|
return $list;
|
|
|
|
|
} else {
|
|
|
|
|
// 基础数据
|
|
|
|
|
$baseCount = $list->count();
|
|
|
|
|
// 额外数据
|
|
|
|
|
$employeeParticipations = EmployeeParticipation::where(function ($query) use ($start_date, $end_date) {
|
|
|
|
|
// 开始结束日期的筛选。or查询
|
|
|
|
|
if ($start_date && $end_date) {
|
|
|
|
|
$query->whereBetween('start_date', [$start_date, $end_date])
|
|
|
|
|
->orWhereBetween('end_date', [$start_date, $end_date]);
|
|
|
|
|
}
|
|
|
|
|
})->where('type', 1)->sum('total');
|
|
|
|
|
// 返回统计数据
|
|
|
|
|
return $list->count();
|
|
|
|
|
return $baseCount + $employeeParticipations;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -626,7 +636,16 @@ class CourseSign extends SoftDeletesModel
|
|
|
|
|
if ($retList) {
|
|
|
|
|
return User::with('company')->whereIn('id', $courseSigns->pluck('user_id'))->get();
|
|
|
|
|
} else {
|
|
|
|
|
return User::whereIn('id', $courseSigns->pluck('user_id'))->count();
|
|
|
|
|
$baseCount = User::whereIn('id', $courseSigns->pluck('user_id'))->count();
|
|
|
|
|
// 额外数据
|
|
|
|
|
$employeeParticipations = EmployeeParticipation::where(function ($query) use ($start_date, $end_date) {
|
|
|
|
|
// 开始结束日期的筛选。or查询
|
|
|
|
|
if ($start_date && $end_date) {
|
|
|
|
|
$query->whereBetween('start_date', [$start_date, $end_date])
|
|
|
|
|
->orWhereBetween('end_date', [$start_date, $end_date]);
|
|
|
|
|
}
|
|
|
|
|
})->where('type', 2)->sum('total');
|
|
|
|
|
return $baseCount + $employeeParticipations;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|