|
|
|
|
@ -115,23 +115,23 @@ class CourseContentCheckController extends BaseController
|
|
|
|
|
}
|
|
|
|
|
})->orderBy($all['sort_name'] ?? 'id', $all['sort_type'] ?? 'desc')
|
|
|
|
|
->orderBy('created_at', 'desc');
|
|
|
|
|
if (isset($all['has_check'])) {
|
|
|
|
|
if ($all['has_check'] == 1) {
|
|
|
|
|
$list = $list->whereHas('courseContentCheck');
|
|
|
|
|
} else {
|
|
|
|
|
$list = $list->whereDoesntHave('courseContentCheck');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// if (isset($all['has_check'])) {
|
|
|
|
|
// if ($all['has_check'] == 1) {
|
|
|
|
|
// $list = $list->whereHas('courseContentCheck');
|
|
|
|
|
// } else {
|
|
|
|
|
// $list = $list->whereDoesntHave('courseContentCheck');
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
if (isset($all['is_export']) && !empty($all['is_export'])) {
|
|
|
|
|
$list = $list->limit(5000)->get()->toArray();
|
|
|
|
|
// foreach ($list as $item) {
|
|
|
|
|
// // 是否存在courseContentCheck
|
|
|
|
|
// if (isset($item['course_content_check'])) {
|
|
|
|
|
// $item->course_content_check_text = '已签到';
|
|
|
|
|
// } else {
|
|
|
|
|
// $item->course_content_check_text = '未签到';
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
foreach ($list as $item) {
|
|
|
|
|
// 是否存在courseContentCheck
|
|
|
|
|
if (isset($item['course_content_check'])) {
|
|
|
|
|
$item->course_content_check_text = '已签到';
|
|
|
|
|
} else {
|
|
|
|
|
$item->course_content_check_text = '未签到';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return Excel::download(new CommonExport($list, $all['export_fields'] ?? ''), $all['file_name'] ?? '' . date('YmdHis') . '.xlsx');
|
|
|
|
|
} else {
|
|
|
|
|
// 输出
|
|
|
|
|
|