Skip to content

Commit

Permalink
后台课程-课时-学员的学习记录返回video_id
Browse files Browse the repository at this point in the history
  • Loading branch information
none committed Jul 19, 2023
1 parent 36bc368 commit e6a8015
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/Backend/Api/V1/CourseController.php
Expand Up @@ -384,6 +384,7 @@ public function videoWatchRecords($courseId, $userId)
if ($chapters->isEmpty()) {
foreach ($videos as $videoItem) {
$tmp = [
'video_id' => $videoItem['id'],
'video_title' => $videoItem['title'],
'duration' => $videoItem['duration'],
'watch_seconds' => $videoWatchRecords[$videoItem['id']]['watch_seconds'] ?? 0,
Expand All @@ -401,6 +402,7 @@ public function videoWatchRecords($courseId, $userId)

foreach ($list as $videoItem) {
$tmp = [
'video_id' => $videoItem['id'],
'video_title' => sprintf('%s-%s', $chapter['title'], $videoItem['title']),
'duration' => $videoItem['duration'],
'watch_seconds' => $videoWatchRecords[$videoItem['id']]['watch_seconds'] ?? 0,
Expand Down

0 comments on commit e6a8015

Please sign in to comment.