master
cody 2 months ago
parent d38076d5c2
commit f8a65ec9ba

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

Loading…
Cancel
Save