diff --git a/app/controllers/course_videos_controller.rb b/app/controllers/course_videos_controller.rb index 3a0b09b4e..c36472de4 100644 --- a/app/controllers/course_videos_controller.rb +++ b/app/controllers/course_videos_controller.rb @@ -35,7 +35,7 @@ class CourseVideosController < ApplicationController @watch_course_videos = @watch_course_videos.where("course_members.course_group_id = ?", params[:group_id]) end - @watch_course_videos = @watch_course_videos.select("count(watch_course_videos.course_video_id) AS freq, watch_course_videos.*") + @watch_course_videos = @watch_course_videos.select("count(watch_course_videos.course_video_id) AS freq, watch_course_videos.id, watch_course_videos.user_id, watch_course_videos.start_at, watch_course_videos.end_at, watch_course_videos.is_finished, watch_course_videos.total_duration") if params[:order].present? key = params[:order].split("-") diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 18255fb2b..b999a91b9 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1520,7 +1520,7 @@ class CoursesController < ApplicationController end end - @videos = @videos.select("course_videos.id, videos.user_id, videos.title, IFNULL(hisotries.time,0) AS total_time, IFNULL(hisotries.num,0) AS people_num") + @videos = @videos.select("course_videos.id, videos.user_id, videos.title AS video_title, IFNULL(hisotries.time,0) AS total_time, IFNULL(hisotries.num,0) AS people_num") @videos = paginate @videos end diff --git a/app/views/course_videos/watch_histories.json.jbuilder b/app/views/course_videos/watch_histories.json.jbuilder index 2babab5d0..fc79f711e 100644 --- a/app/views/course_videos/watch_histories.json.jbuilder +++ b/app/views/course_videos/watch_histories.json.jbuilder @@ -1,5 +1,6 @@ json.data do json.array! @watch_course_videos do |d| + json.id d.id json.user_name d.user&.real_name json.is_finished d.is_finished ? true : false json.total_duration d.total_duration.round(0) diff --git a/app/views/courses/watch_video_histories.json.jbuilder b/app/views/courses/watch_video_histories.json.jbuilder index 8efab4a20..7ae2c764e 100644 --- a/app/views/courses/watch_video_histories.json.jbuilder +++ b/app/views/courses/watch_video_histories.json.jbuilder @@ -1,7 +1,7 @@ json.videos do json.array! @videos do |v| json.id v.id - json.title v.title + json.title v['video_title'] json.user_name v.user&.real_name json.people_num v['people_num'] json.total_time v['total_time'].round(0) diff --git a/public/react/src/modules/courses/videostatistics/component/Studenticscom.js b/public/react/src/modules/courses/videostatistics/component/Studenticscom.js index ea9c20e8f..5d1c81692 100644 --- a/public/react/src/modules/courses/videostatistics/component/Studenticscom.js +++ b/public/react/src/modules/courses/videostatistics/component/Studenticscom.js @@ -1,7 +1,7 @@ import React, {Component} from "react"; import '../../signin/css/signincdi.css'; import {Progress, message} from 'antd'; -import {getImageUrl} from 'educoder'; +import {getImageUrl,formatSeconds} from 'educoder'; import axios from 'axios'; @@ -88,7 +88,7 @@ class Studenticscom extends Component {