|
|
|
|
@ -131,11 +131,14 @@ class CourseContentCheckController extends BaseController
|
|
|
|
|
if (isset($all['is_export']) && !empty($all['is_export'])) {
|
|
|
|
|
$list = $list->limit(5000)->get()->toArray();
|
|
|
|
|
foreach ($list as &$item) {
|
|
|
|
|
$courseContentCheck = CourseContentCheck::where('course_id', $item->course_id)
|
|
|
|
|
$courseContentCheck = CourseContentCheck::where('user_id', $item['user_id'])
|
|
|
|
|
->where(function ($query) use ($all) {
|
|
|
|
|
if (isset($all['course_content_id'])) {
|
|
|
|
|
$query->where('course_content_id', $all['course_content_id']);
|
|
|
|
|
}
|
|
|
|
|
if (isset($all['course_id'])) {
|
|
|
|
|
$query->where('course_id', $all['course_id']);
|
|
|
|
|
}
|
|
|
|
|
})->first();
|
|
|
|
|
// 是否存在courseContentCheck
|
|
|
|
|
if ($courseContentCheck) {
|
|
|
|
|
@ -149,11 +152,14 @@ class CourseContentCheckController extends BaseController
|
|
|
|
|
// 输出
|
|
|
|
|
$list = $list->paginate($all['page_size'] ?? 20);
|
|
|
|
|
foreach ($list as $item) {
|
|
|
|
|
$item->course_content_check = CourseContentCheck::where('course_id', $item->course_id)
|
|
|
|
|
$item->course_content_check = CourseContentCheck::where('user_id', $item->user_id)
|
|
|
|
|
->where(function ($query) use ($all) {
|
|
|
|
|
if (isset($all['course_content_id'])) {
|
|
|
|
|
$query->where('course_content_id', $all['course_content_id']);
|
|
|
|
|
}
|
|
|
|
|
if (isset($all['course_id'])) {
|
|
|
|
|
$query->where('course_id', $all['course_id']);
|
|
|
|
|
}
|
|
|
|
|
})->first();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|