This commit is contained in:
parent
d9753a7fc8
commit
c483ab88b5
@ -16,8 +16,8 @@ class CoursePlayerService
|
|||||||
{
|
{
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
|
|
||||||
return $watching_type === 'lesson' ?
|
if ($watching_type === 'lesson') {
|
||||||
SectionLesson::with([
|
return SectionLesson::with([
|
||||||
'resources',
|
'resources',
|
||||||
'forums' => function ($query) {
|
'forums' => function ($query) {
|
||||||
$query->with([
|
$query->with([
|
||||||
@ -27,13 +27,15 @@ class CoursePlayerService
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
])->find($lesson_id) :
|
])->findOrFail($lesson_id);
|
||||||
SectionQuiz::with([
|
}
|
||||||
'quiz_questions',
|
|
||||||
'quiz_submissions' => function ($query) use ($user) {
|
return SectionQuiz::with([
|
||||||
$query->where('user_id', $user->id);
|
'quiz_questions',
|
||||||
}
|
'quiz_submissions' => function ($query) use ($user) {
|
||||||
])->find($lesson_id);
|
$query->where('user_id', $user->id);
|
||||||
|
}
|
||||||
|
])->findOrFail($lesson_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWatchHistory(string $course_id, ?string $user_id): ?WatchHistory
|
function getWatchHistory(string $course_id, ?string $user_id): ?WatchHistory
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user