master
cody 3 weeks ago
parent 1fbce489c7
commit 4bbb3872a5

@ -331,7 +331,7 @@ class OtherController extends CommonController
'contact_phone' => $company->contact_phone ?? '', 'contact_phone' => $company->contact_phone ?? '',
'contact_mail' => $company->contact_mail ?? '', 'contact_mail' => $company->contact_mail ?? '',
'company_tag' => $company->company_tag ?? '', 'company_tag' => $company->company_tag ?? '',
'credit_code' => ' '.$company->credit_code ?? '', 'credit_code' => ' ' . $company->credit_code ?? '',
]; ];
} }
$fields = [ $fields = [
@ -411,9 +411,11 @@ class OtherController extends CommonController
foreach ($users as $user) { foreach ($users as $user) {
// 获取该学员报名的课程列表与coursesHome逻辑保持一致 // 获取该学员报名的课程列表与coursesHome逻辑保持一致
$userCourseSigns = CourseSign::where('user_id', $user->id) $userCourseSigns = CourseSign::where('user_id', $user->id)
->whereDate('created_at', '>=', $start_date) ->whereHas('course', function ($query) use ($start_date, $end_date) {
->whereDate('created_at', '<=', $end_date) // 开始结束日期的筛选。or查询
->where('status', 1) $query->whereBetween('start_date', [$start_date, $end_date])
->whereBetween('end_date', [$start_date, $end_date]);
})->where('status', 1)
->where(function ($query) use ($course_ids) { ->where(function ($query) use ($course_ids) {
if ($course_ids->isNotEmpty()) { if ($course_ids->isNotEmpty()) {
$query->whereIn('course_id', $course_ids); $query->whereIn('course_id', $course_ids);

Loading…
Cancel
Save