|
|
|
@ -131,14 +131,14 @@ class CourseContentCheckController extends BaseController
|
|
|
|
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) {
|
|
|
|
$courseContentChecks = CourseContentCheck::where('course_id', $item->course_id)
|
|
|
|
$courseContentCheck = CourseContentCheck::where('course_id', $item->course_id)
|
|
|
|
->where(function ($query) use ($all) {
|
|
|
|
->where(function ($query) use ($all) {
|
|
|
|
if (isset($all['course_content_id'])) {
|
|
|
|
if (isset($all['course_content_id'])) {
|
|
|
|
$query->where('course_content_id', $all['course_content_id']);
|
|
|
|
$query->where('course_content_id', $all['course_content_id']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})->first();
|
|
|
|
})->first();
|
|
|
|
// 是否存在courseContentCheck
|
|
|
|
// 是否存在courseContentCheck
|
|
|
|
if ($courseContentChecks) {
|
|
|
|
if ($courseContentCheck) {
|
|
|
|
$item['course_content_check_text'] = '已签到';
|
|
|
|
$item['course_content_check_text'] = '已签到';
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$item['course_content_check_text'] = '未签到';
|
|
|
|
$item['course_content_check_text'] = '未签到';
|
|
|
|
@ -149,7 +149,7 @@ class CourseContentCheckController extends BaseController
|
|
|
|
// 输出
|
|
|
|
// 输出
|
|
|
|
$list = $list->paginate($all['page_size'] ?? 20);
|
|
|
|
$list = $list->paginate($all['page_size'] ?? 20);
|
|
|
|
foreach ($list as $item) {
|
|
|
|
foreach ($list as $item) {
|
|
|
|
$item->course_content_checks = CourseContentCheck::where('course_id', $item->course_id)
|
|
|
|
$item->course_content_check = CourseContentCheck::where('course_id', $item->course_id)
|
|
|
|
->where(function ($query) use ($all) {
|
|
|
|
->where(function ($query) use ($all) {
|
|
|
|
if (isset($all['course_content_id'])) {
|
|
|
|
if (isset($all['course_content_id'])) {
|
|
|
|
$query->where('course_content_id', $all['course_content_id']);
|
|
|
|
$query->where('course_content_id', $all['course_content_id']);
|
|
|
|
|