From cde584b027cd3ddebfc101a256d6b07f85b6bd49 Mon Sep 17 00:00:00 2001 From: anke1460 Date: Fri, 13 Mar 2020 17:08:38 +0800 Subject: [PATCH 01/69] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E8=A7=82=E7=9C=8B=E7=BB=93=E6=9D=9F=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/create_watch_video_service.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/services/create_watch_video_service.rb b/app/services/create_watch_video_service.rb index afdd57b5b..9432c65bc 100644 --- a/app/services/create_watch_video_service.rb +++ b/app/services/create_watch_video_service.rb @@ -31,7 +31,9 @@ class CreateWatchVideoService < ApplicationService if watch_course_video.present? && !watch_course_video.is_finished && watch_course_video.watch_duration < params[:watch_duration].to_f # 更新课程视频的时长及是否看完状态 watch_course_video.watch_duration = params[:watch_duration] - watch_course_video.is_finished = (watch_course_video.duration <= params[:watch_duration].to_f) + if params[:ed].present? + watch_course_video.is_finished = watch_course_video.watch_video_histories.sum(:total_duration) >= watch_course_video.duration + end watch_course_video.end_at = current_time watch_course_video.save! end From 50abaefa7f8d12394cff52ff00ed926679cb326d Mon Sep 17 00:00:00 2001 From: anke1460 Date: Fri, 13 Mar 2020 17:16:09 +0800 Subject: [PATCH 02/69] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E7=BB=93=E6=9D=9F=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/create_watch_video_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/create_watch_video_service.rb b/app/services/create_watch_video_service.rb index 9432c65bc..28cf36838 100644 --- a/app/services/create_watch_video_service.rb +++ b/app/services/create_watch_video_service.rb @@ -23,7 +23,7 @@ class CreateWatchVideoService < ApplicationService watch_video_history.end_at = current_time watch_video_history.total_duration = params[:total_duration] watch_video_history.watch_duration = params[:watch_duration].to_f > watch_video_history.duration ? watch_video_history.duration : params[:watch_duration] - watch_video_history.is_finished = (watch_video_history.duration <= params[:watch_duration].to_f) + watch_video_history.is_finished = params[:ed].present? watch_video_history.save! watch_course_video = watch_video_history.watch_course_video From e6aa87349e34c700932f90cee7660d89d458c953 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 13 Mar 2020 17:44:59 +0800 Subject: [PATCH 03/69] =?UTF-8?q?=E6=BC=8F=E6=B4=9E=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 3f202c994..b1920239c 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -70,7 +70,7 @@ class ShixunsController < ApplicationController end ## 排序参数 - bsort = params[:sort] || 'desc' + bsort = (params[:sort] == "desc" ? "desc" : "asc") case params[:order_by] || 'new' when 'hot' @shixuns = @shixuns.order("shixuns.public = 2 desc, shixuns.myshixuns_count #{bsort}") From b852a9a2971064cf8ea461d94be64d595cf9ce17 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 13 Mar 2020 17:50:19 +0800 Subject: [PATCH 04/69] =?UTF-8?q?=E8=B4=B4=E5=90=A7sql=E6=B3=A8=E5=85=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index c0ea8d601..ef61ea202 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -12,7 +12,14 @@ class MemosController < ApplicationController def index @user = current_user @memos = Memo.all - s_order = (params[:order] == "replies_count" ? "all_replies_count" : params[:order]) || "updated_at" + # replies_count created_at updated_at + s_order = + case params[:order] + when 'replies_count' then 'all_replies_count' + when 'created_at' then 'created_at' + else + 'updated_at' + end # @tidding_count = unviewed_tiddings(current_user) if current_user.present? page = params[:page] || 1 limit = params[:limit] || 15 From 54d3338afef473c4182b183bcaceda31eb7632e2 Mon Sep 17 00:00:00 2001 From: anke1460 Date: Fri, 13 Mar 2020 19:08:14 +0800 Subject: [PATCH 05/69] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=97=B6=E9=95=BF=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 21 +++++++++++++++++-- app/services/create_watch_video_service.rb | 5 ++++- app/views/courses/course_videos.json.jbuilder | 2 ++ .../watch_video_histories.json.jbuilder | 10 +++++++++ config/routes.rb | 1 + ...total_duration_to_watch_course_duration.rb | 8 +++++++ 6 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 app/views/courses/watch_video_histories.json.jbuilder create mode 100644 db/migrate/20200313104522_add_total_duration_to_watch_course_duration.rb diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 124fc1094..2c1a78b86 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -30,7 +30,7 @@ class CoursesController < ApplicationController :informs, :update_informs, :online_learning, :update_task_position, :tasks_list, :join_excellent_course, :export_couser_info, :export_member_act_score, :new_informs, :delete_informs, :change_member_role, :course_groups, :join_course_group, :statistics, - :work_score, :act_score, :calculate_all_shixun_scores, :move_to_category] + :work_score, :act_score, :calculate_all_shixun_scores, :move_to_category, :watch_video_histories] before_action :user_course_identity, except: [:join_excellent_course, :index, :create, :new, :apply_to_join_course, :search_course_list, :get_historical_course_students, :mine, :search_slim, :board_list] before_action :teacher_allowed, only: [:update, :destroy, :settings, :search_teacher_candidate, @@ -114,7 +114,7 @@ class CoursesController < ApplicationController #sql = "left join videos on videos.id=course_videos.video_id AND (videos.transcoded=1 OR videos.user_id = #{current_user.id})" #@videos = paginate videos.joins(sql).includes(video: [user: :user_extension], user: :user_extension) - videos = videos.includes(video: [user: :user_extension], user: :user_extension) + videos = videos.includes(:watch_course_videos, video: [user: :user_extension],user: :user_extension) videos = videos.where(videos: {transcoded: true}) .or(videos.where(videos: {user_id: current_user.id})) .or(videos.where(course_videos: {is_link: true})) @@ -1481,6 +1481,23 @@ class CoursesController < ApplicationController end end + def watch_video_histories + @videos = CourseVideo.find_by_sql(" + SELECT course_videos.id, videos.user_id, videos.title, IFNULL(hisotries.time,0) AS time, IFNULL(hisotries.num,0) AS num + FROM course_videos + JOIN videos ON course_videos.course_id = #{@course.id} AND videos.id = course_videos.video_id + LEFT JOIN ( + SELECT watch_course_videos.course_video_id, sum(watch_course_videos.total_duration) AS time, count(watch_course_videos.course_video_id) AS num + FROM watch_course_videos + JOIN course_videos ON course_videos.id = watch_course_videos.course_video_id + WHERE course_videos.course_id = #{@course.id} + GROUP BY watch_course_videos.course_video_id + ) AS hisotries ON hisotries.course_video_id = course_videos.id + ") + @count = @videos.count + @videos = paginate @videos + end + private # Use callbacks to share common setup or constraints between actions. diff --git a/app/services/create_watch_video_service.rb b/app/services/create_watch_video_service.rb index 28cf36838..f2d360638 100644 --- a/app/services/create_watch_video_service.rb +++ b/app/services/create_watch_video_service.rb @@ -28,13 +28,16 @@ class CreateWatchVideoService < ApplicationService watch_course_video = watch_video_history.watch_course_video + watch_course_video.total_duration = watch_course_video.watch_video_histories.sum(:total_duration) + watch_course_video.end_at = current_time + watch_course_video.save! + if watch_course_video.present? && !watch_course_video.is_finished && watch_course_video.watch_duration < params[:watch_duration].to_f # 更新课程视频的时长及是否看完状态 watch_course_video.watch_duration = params[:watch_duration] if params[:ed].present? watch_course_video.is_finished = watch_course_video.watch_video_histories.sum(:total_duration) >= watch_course_video.duration end - watch_course_video.end_at = current_time watch_course_video.save! end end diff --git a/app/views/courses/course_videos.json.jbuilder b/app/views/courses/course_videos.json.jbuilder index bee5e89cb..2e557828b 100644 --- a/app/views/courses/course_videos.json.jbuilder +++ b/app/views/courses/course_videos.json.jbuilder @@ -10,6 +10,8 @@ json.videos @videos do |video| json.user_login user&.login else json.partial! 'users/videos/video', locals: { video: video.video } + json.total_time video.watch_course_videos.sum(:total_duration) + json.people_num video.watch_course_videos.count(:user_id) end end diff --git a/app/views/courses/watch_video_histories.json.jbuilder b/app/views/courses/watch_video_histories.json.jbuilder new file mode 100644 index 000000000..4e7a4b174 --- /dev/null +++ b/app/views/courses/watch_video_histories.json.jbuilder @@ -0,0 +1,10 @@ +json.videos do + json.array! @videos do |v| + json.id v.id + json.title v.title + json.user_name v.user&.real_name + json.people_num v.num + json.total_time v.time + end +end +json.count @count \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 6c3efcfe8..881324e61 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -531,6 +531,7 @@ Rails.application.routes.draw do post :inform_up post :inform_down get :calculate_all_shixun_scores + get :watch_video_histories end collection do diff --git a/db/migrate/20200313104522_add_total_duration_to_watch_course_duration.rb b/db/migrate/20200313104522_add_total_duration_to_watch_course_duration.rb new file mode 100644 index 000000000..400e52ac8 --- /dev/null +++ b/db/migrate/20200313104522_add_total_duration_to_watch_course_duration.rb @@ -0,0 +1,8 @@ +class AddTotalDurationToWatchCourseDuration < ActiveRecord::Migration[5.2] + def change + add_column :watch_course_videos, :total_duration, :float, default: 0 + WatchVideoHistory.where("created_at < '2020-03-14 00:00:00'").each do |d| + d.watch_course_video.increment!(:total_duration, d.total_duration) if d.watch_course_video.present? + end + end +end From d43599d8aed4cacf6923f30bb79597a399ca2214 Mon Sep 17 00:00:00 2001 From: harry Date: Fri, 13 Mar 2020 19:26:18 +0800 Subject: [PATCH 06/69] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=96=B0=E5=A2=9E=E5=8F=82=E6=95=B0=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ .../react/src/modules/courses/Video/video-play/index.jsx | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 349c0cdc1..544539736 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ # Ignore bundler config. /.bundle /bundle +/node_modules # Ignore lock config file *.lock @@ -46,6 +47,8 @@ /public/h5build /public/npm-debug.log +/dist + # avatars /public/images/avatars diff --git a/public/react/src/modules/courses/Video/video-play/index.jsx b/public/react/src/modules/courses/Video/video-play/index.jsx index 84b465014..cfc5ad343 100644 --- a/public/react/src/modules/courses/Video/video-play/index.jsx +++ b/public/react/src/modules/courses/Video/video-play/index.jsx @@ -43,7 +43,7 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => { let isSeeking = false let pos = []//播放时间点集 - const log = useCallback((callback) => { + const log = useCallback((callback, isEnd = false) => { let params = {} if (logId) { params['log_id'] = logId @@ -59,6 +59,9 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => { params['duration'] = totalDuration params['device'] = device } + if (isEnd) { + params['ed'] = "1" + } async function getLogId() { isLoging = true let id = await logWatchHistory(params) @@ -119,7 +122,7 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => { isLoging = false isSeeking = false pos = [] - }) + }, true) } function onTimeupdate() { From 0f509921cc25a06eae1ed577bc91673e5f4f8f0d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 13 Mar 2020 19:49:26 +0800 Subject: [PATCH 07/69] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 6a7f7b4b0..8e6356201 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -367,9 +367,9 @@ class FilesController < ApplicationController @category_name = category.try(:module_name) else @category = CourseSecondCategory.find category_id - @category_id = category.try(:id) - @category_name = category.try(:name) - @parent_category_id = category&.parent_id.to_i + @category_id = @category.try(:id) + @category_name = @category.try(:name) + @parent_category_id = @category&.parent_id.to_i end end From b402210be239f75db6d58b7c46e27a738c0c7106 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 13 Mar 2020 19:56:52 +0800 Subject: [PATCH 08/69] =?UTF-8?q?=E7=AD=BE=E5=88=B0=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 99925505f..acad8cda9 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -82,7 +82,7 @@ module CoursesHelper when "video" "/classrooms/#{course.id}/course_videos" when "attendance" - "/classrooms/#{course.id}/signin" + "/classrooms/#{course.id}/attendance" end end From 36fd9f23b214fd0cb56ebad0cc3e1a421d8c0e05 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 13 Mar 2020 19:57:32 +0800 Subject: [PATCH 09/69] =?UTF-8?q?=E7=AD=BE=E5=88=B0=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index acad8cda9..4e088c0fd 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -82,7 +82,7 @@ module CoursesHelper when "video" "/classrooms/#{course.id}/course_videos" when "attendance" - "/classrooms/#{course.id}/attendance" + "/classrooms/#{course.id}/attendances" end end From f06c19278c040fdfbe1a74a63ba32bfafd547e63 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Fri, 13 Mar 2020 21:05:36 +0800 Subject: [PATCH 10/69] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/queries/weapps/subject_query.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/queries/weapps/subject_query.rb b/app/queries/weapps/subject_query.rb index 0a3c9beb2..f062e40ff 100644 --- a/app/queries/weapps/subject_query.rb +++ b/app/queries/weapps/subject_query.rb @@ -8,7 +8,7 @@ class Weapps::SubjectQuery < ApplicationQuery end def call - subjects = @current_laboratory.subjects.unhidden.publiced + subjects = @current_laboratory.subjects.unhidden.publiced.show_moblied # 课程体系的过滤 if params[:sub_discipline_id].present? From cef07e523232203a85825b62d9b46197d2dbe158 Mon Sep 17 00:00:00 2001 From: anke1460 Date: Fri, 13 Mar 2020 21:06:21 +0800 Subject: [PATCH 11/69] =?UTF-8?q?fix=20=E9=9D=9E=E8=AF=BE=E5=A0=82?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E8=AE=B0=E5=BD=95=E6=97=B6=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/create_watch_video_service.rb | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/app/services/create_watch_video_service.rb b/app/services/create_watch_video_service.rb index f2d360638..b110bcc97 100644 --- a/app/services/create_watch_video_service.rb +++ b/app/services/create_watch_video_service.rb @@ -28,17 +28,18 @@ class CreateWatchVideoService < ApplicationService watch_course_video = watch_video_history.watch_course_video - watch_course_video.total_duration = watch_course_video.watch_video_histories.sum(:total_duration) - watch_course_video.end_at = current_time - watch_course_video.save! - - if watch_course_video.present? && !watch_course_video.is_finished && watch_course_video.watch_duration < params[:watch_duration].to_f - # 更新课程视频的时长及是否看完状态 - watch_course_video.watch_duration = params[:watch_duration] - if params[:ed].present? - watch_course_video.is_finished = watch_course_video.watch_video_histories.sum(:total_duration) >= watch_course_video.duration - end + if watch_course_video.present? + watch_course_video.total_duration = watch_course_video.watch_video_histories.sum(:total_duration) + watch_course_video.end_at = current_time watch_course_video.save! + if !watch_course_video.is_finished && watch_course_video.watch_duration < params[:watch_duration].to_f + # 更新课程视频的时长及是否看完状态 + watch_course_video.watch_duration = params[:watch_duration] + if params[:ed].present? + watch_course_video.is_finished = watch_course_video.total_duration >= watch_course_video.duration + end + watch_course_video.save! + end end end else From 7d2fe47def5da0de5d4e319c3090eac002820f0d Mon Sep 17 00:00:00 2001 From: anke1460 Date: Fri, 13 Mar 2020 21:15:59 +0800 Subject: [PATCH 12/69] =?UTF-8?q?fix=20=E8=AF=BE=E5=A0=82=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=88=9B=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/create_watch_video_service.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/services/create_watch_video_service.rb b/app/services/create_watch_video_service.rb index b110bcc97..e42f490d9 100644 --- a/app/services/create_watch_video_service.rb +++ b/app/services/create_watch_video_service.rb @@ -51,11 +51,10 @@ class CreateWatchVideoService < ApplicationService d.start_at = current_time d.duration = params[:duration] end - - watch_video_history = build_video_log(current_time, course_video.video_id, watch_course_video.id) - watch_video_history.save! watch_course_video.save! unless watch_course_video.persisted? + watch_video_history = build_video_log(current_time, course_video.video_id, watch_course_video.id) + watch_video_history.save! else # 非课堂视频 video = Video.find(params[:video_id]) From 853f9999231e878a27eec96524dde466ba5cbcb2 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 13 Mar 2020 21:26:36 +0800 Subject: [PATCH 13/69] =?UTF-8?q?=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attendances/index.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/attendances/index.json.jbuilder b/app/views/attendances/index.json.jbuilder index 8a4dd2bb1..21fc68d71 100644 --- a/app/views/attendances/index.json.jbuilder +++ b/app/views/attendances/index.json.jbuilder @@ -1,5 +1,5 @@ json.attendances @attendances do |attendance| - json.(attendance, :id, :name, :normal_count, :all_count, :mode) + json.(attendance, :id, :name, :normal_count, :all_count, :mode, :code) json.author do user = attendance.user json.user_name user.real_name From 5df56b2d858c4ae662b88a3b1b3a295e658955ef Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 13 Mar 2020 21:28:49 +0800 Subject: [PATCH 14/69] =?UTF-8?q?=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attendances/index.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/attendances/index.json.jbuilder b/app/views/attendances/index.json.jbuilder index 21fc68d71..b44f9a4fe 100644 --- a/app/views/attendances/index.json.jbuilder +++ b/app/views/attendances/index.json.jbuilder @@ -1,5 +1,5 @@ json.attendances @attendances do |attendance| - json.(attendance, :id, :name, :normal_count, :all_count, :mode, :code) + json.(attendance, :id, :name, :normal_count, :all_count, :mode, :attendance_code) json.author do user = attendance.user json.user_name user.real_name From 46e5582afd168da701ee3ce4b3106cc10f8396b2 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 13 Mar 2020 21:51:06 +0800 Subject: [PATCH 15/69] =?UTF-8?q?=E7=AD=BE=E5=88=B0=E5=BA=8F=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/weapps/course_member_attendances_controller.rb | 3 +++ app/views/weapps/course_member_attendances/index.json.jbuilder | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/weapps/course_member_attendances_controller.rb b/app/controllers/weapps/course_member_attendances_controller.rb index 5e92d5928..21a687d60 100644 --- a/app/controllers/weapps/course_member_attendances_controller.rb +++ b/app/controllers/weapps/course_member_attendances_controller.rb @@ -14,6 +14,9 @@ class Weapps::CourseMemberAttendancesController < ApplicationController @members = @members.where(course_group_id: params[:group_ids]) end + @page = params[:page] || 1 + @limit = params[:limit] || 5 + if params[:attendance_status].present? @members = @members.joins(:course_member_attendances).where(course_member_attendances: {course_attendance_id: attendance.id, attendance_status: params[:attendance_status]}) end diff --git a/app/views/weapps/course_member_attendances/index.json.jbuilder b/app/views/weapps/course_member_attendances/index.json.jbuilder index cec70b3fe..01d475e12 100644 --- a/app/views/weapps/course_member_attendances/index.json.jbuilder +++ b/app/views/weapps/course_member_attendances/index.json.jbuilder @@ -4,8 +4,9 @@ # json.student_id member.user&.student_id # end -json.member_attendances @members.each do |member| +json.member_attendances @members.each_with_index do |member, index| json.(member, :user_id) + json.index (@page.to_i - 1) * @limit.to_i + index + 1 json.user_name member.user&.real_name json.student_id member.user&.student_id json.attendance_status @member_attendances.select{|attendance| attendance.course_member_id == member.id}.first&.attendance_status || "ABSENCE" From d65e12f7dd7826901b53c5fdb472e2c8d9eca26b Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 13 Mar 2020 21:54:39 +0800 Subject: [PATCH 16/69] =?UTF-8?q?=E7=AD=BE=E5=88=B0=E5=BA=8F=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/weapps/course_member_attendances/index.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/weapps/course_member_attendances/index.json.jbuilder b/app/views/weapps/course_member_attendances/index.json.jbuilder index 01d475e12..765de5833 100644 --- a/app/views/weapps/course_member_attendances/index.json.jbuilder +++ b/app/views/weapps/course_member_attendances/index.json.jbuilder @@ -4,7 +4,7 @@ # json.student_id member.user&.student_id # end -json.member_attendances @members.each_with_index do |member, index| +json.member_attendances @members.each_with_index.to_a do |member, index| json.(member, :user_id) json.index (@page.to_i - 1) * @limit.to_i + index + 1 json.user_name member.user&.real_name From 5813ca5fcbe60c0f130bec58d386b801a60b5ec7 Mon Sep 17 00:00:00 2001 From: anke1460 Date: Fri, 13 Mar 2020 22:14:48 +0800 Subject: [PATCH 17/69] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=97=B6=E9=95=BF?= =?UTF-8?q?=E7=B2=BE=E5=BA=A6=E9=99=90=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- .../watch_video_histories_controller.rb | 2 +- app/services/create_watch_video_service.rb | 21 ++++++++++--------- app/views/courses/course_videos.json.jbuilder | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 2c1a78b86..d701575e7 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -114,7 +114,7 @@ class CoursesController < ApplicationController #sql = "left join videos on videos.id=course_videos.video_id AND (videos.transcoded=1 OR videos.user_id = #{current_user.id})" #@videos = paginate videos.joins(sql).includes(video: [user: :user_extension], user: :user_extension) - videos = videos.includes(:watch_course_videos, video: [user: :user_extension],user: :user_extension) + videos = videos.includes(video: [user: :user_extension],user: :user_extension).select("course_videos.id, course_videos.title, course_videos.link, course_videos.user_id") videos = videos.where(videos: {transcoded: true}) .or(videos.where(videos: {user_id: current_user.id})) .or(videos.where(course_videos: {is_link: true})) diff --git a/app/controllers/watch_video_histories_controller.rb b/app/controllers/watch_video_histories_controller.rb index 15ee62113..fe1fbf31b 100644 --- a/app/controllers/watch_video_histories_controller.rb +++ b/app/controllers/watch_video_histories_controller.rb @@ -5,6 +5,6 @@ class WatchVideoHistoriesController < ApplicationController watch_log = CreateWatchVideoService.new(current_user, request, params).call render_ok(log_id: watch_log&.id) rescue CreateWatchVideoService::Error => ex - render_error(ex.message) + render_ok(log_id: watch_log&.id) end end diff --git a/app/services/create_watch_video_service.rb b/app/services/create_watch_video_service.rb index e42f490d9..0f1b32814 100644 --- a/app/services/create_watch_video_service.rb +++ b/app/services/create_watch_video_service.rb @@ -10,19 +10,21 @@ class CreateWatchVideoService < ApplicationService def call ActiveRecord::Base.transaction do current_time = Time.now + params[:watch_duration] = params[:watch_duration].to_f.round(2) + params[:total_duration] = params[:total_duration].to_f.round(2) + params[:duration] = params[:duration].to_f.round(2) + if params[:log_id].present? - if params[:total_duration].to_f < params[:watch_duration].to_f || params[:watch_duration].to_f < 0 - raise Error, '观看时长错误' + watch_video_history = user.watch_video_histories.find(params[:log_id]) + if params[:total_duration] < params[:watch_duration] + return watch_video_history end # 更新观看时长 - watch_video_history = user.watch_video_histories.find(params[:log_id]) - - if watch_video_history.present? && watch_video_history.watch_duration <= params[:watch_duration].to_f && params[:total_duration].to_f > watch_video_history.total_duration + if watch_video_history.present? && !watch_video_history.is_finished && watch_video_history.watch_duration <= params[:watch_duration] && watch_video_history.total_duration <= params[:total_duration] # 如果观看总时长没变,说明视频没有播放,无需再去记录 - watch_video_history.end_at = current_time watch_video_history.total_duration = params[:total_duration] - watch_video_history.watch_duration = params[:watch_duration].to_f > watch_video_history.duration ? watch_video_history.duration : params[:watch_duration] + watch_video_history.watch_duration = params[:watch_duration] > watch_video_history.duration ? watch_video_history.duration : params[:watch_duration] watch_video_history.is_finished = params[:ed].present? watch_video_history.save! @@ -31,15 +33,14 @@ class CreateWatchVideoService < ApplicationService if watch_course_video.present? watch_course_video.total_duration = watch_course_video.watch_video_histories.sum(:total_duration) watch_course_video.end_at = current_time - watch_course_video.save! - if !watch_course_video.is_finished && watch_course_video.watch_duration < params[:watch_duration].to_f + if !watch_course_video.is_finished && watch_course_video.watch_duration < params[:watch_duration] # 更新课程视频的时长及是否看完状态 watch_course_video.watch_duration = params[:watch_duration] if params[:ed].present? watch_course_video.is_finished = watch_course_video.total_duration >= watch_course_video.duration end - watch_course_video.save! end + watch_course_video.save! end end else diff --git a/app/views/courses/course_videos.json.jbuilder b/app/views/courses/course_videos.json.jbuilder index 2e557828b..c2a4c1282 100644 --- a/app/views/courses/course_videos.json.jbuilder +++ b/app/views/courses/course_videos.json.jbuilder @@ -10,7 +10,7 @@ json.videos @videos do |video| json.user_login user&.login else json.partial! 'users/videos/video', locals: { video: video.video } - json.total_time video.watch_course_videos.sum(:total_duration) + json.total_time video.watch_course_videos.sum(:total_duration).round(0) json.people_num video.watch_course_videos.count(:user_id) end end From 3dc6f84ab7794ad4db7e5e732620cbdf4897ba86 Mon Sep 17 00:00:00 2001 From: dinglink <837816638@qq.com> Date: Fri, 13 Mar 2020 22:40:27 +0800 Subject: [PATCH 18/69] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=8F=8A=E8=A7=82=E7=9C=8B=E4=BA=BA=E6=95=B0?= =?UTF-8?q?=E5=AD=A6=E4=B9=A0=E6=97=B6=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/Video/Video.js | 6 +++++- .../user/usersInfo/video/InfosVideo.css | 1 + .../user/usersInfo/video/VideoInReviewItem.js | 20 ++++++++++++------- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/courses/Video/Video.js b/public/react/src/modules/courses/Video/Video.js index 91d947300..1ad16d702 100644 --- a/public/react/src/modules/courses/Video/Video.js +++ b/public/react/src/modules/courses/Video/Video.js @@ -240,8 +240,12 @@ class Video extends Component { { videos && videos.length > 0 ? - +

{videoData && videoData.count} 个视频

+ +

播放数据从2020-03-13 24:00开始统计

+
+
{ videos.map((item, key) => { diff --git a/public/react/src/modules/user/usersInfo/video/InfosVideo.css b/public/react/src/modules/user/usersInfo/video/InfosVideo.css index fb78f9e85..a03a2c6f6 100644 --- a/public/react/src/modules/user/usersInfo/video/InfosVideo.css +++ b/public/react/src/modules/user/usersInfo/video/InfosVideo.css @@ -70,6 +70,7 @@ } .videoItem .time { + height: 15px; color: #C0C4CC; } .videoItem .square-main .buttonRow .dianjilianicon{ diff --git a/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js b/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js index 4e0ca8fb2..dd4de7ecd 100644 --- a/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js +++ b/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js @@ -21,7 +21,7 @@ const clipboardMap = {} function VideoInReviewItem (props) { const theme = useContext(ThemeContext); const { history, file_url , play_url , cover_url , transcoded , title, created_at, published_at, isReview, id - , onEditVideo, onMaskClick, getCopyText, showNotification,vv,play_duration,operation , deleteVideo , moveVideo ,link} = props; + , onEditVideo, onMaskClick, getCopyText, showNotification,vv,play_duration,operation , deleteVideo , moveVideo ,link, people_num,total_time} = props; useEffect(()=> { if (!isReview) { _clipboard = new ClipboardJS(`.copybtn_item_${id}`); @@ -37,6 +37,8 @@ function VideoInReviewItem (props) { } } }, []) + + const username = props.match.params.username function toList() { history.push(`/users/${username}/videos`) @@ -60,7 +62,7 @@ function VideoInReviewItem (props) { {!isReview && !link && transcoded &&
onMaskClick(props)}> - {play_duration===0?"":
累计学习时长:{play_duration} h
} + {/* {play_duration===0?"":
累计学习时长:{play_duration} h
} */}
} @@ -69,16 +71,20 @@ function VideoInReviewItem (props) { title={title && title.length > 20 ? title : ''} >{title}
- - {moment(published_at || created_at).format('YYYY-MM-DD HH:mm:ss')} + {/*
累计学习时长:{play_duration} h
*/} + {/* {moment(published_at || created_at).format('YYYY-MM-DD HH:mm:ss')}{people_num} */} + {link ? :累计学习时长:{ + total_time<60?total_time+' s':total_time/60<60?(total_time/60).toFixed(0)+' min':(total_time/60/60).toFixed(1)+ ' h'}}
{/* 2019-09-01 10:00:22 */} - {!vv || (vv && vv)===0 ? "" : - - } {!vv || (vv && vv)===0?"":vv} + {!people_num || (people_num && people_num)===0 ? "" : + {!people_num || (people_num && people_num)===0?"":people_num} + } + +
{ isReview !== true && moveVideo && From 597632478dec980aa215f1366b84bcefd61ecb7b Mon Sep 17 00:00:00 2001 From: dinglink <837816638@qq.com> Date: Fri, 13 Mar 2020 23:29:22 +0800 Subject: [PATCH 19/69] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=97=B6=E5=88=86=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/common/DateUtil.js | 30 +++++++++++++++++++ public/react/src/common/educoder.js | 2 +- .../react/src/modules/courses/Video/Video.js | 2 +- .../user/usersInfo/video/VideoInReviewItem.js | 7 +++-- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/public/react/src/common/DateUtil.js b/public/react/src/common/DateUtil.js index dc2288ff3..4bc481b10 100644 --- a/public/react/src/common/DateUtil.js +++ b/public/react/src/common/DateUtil.js @@ -38,6 +38,36 @@ export function getNextHalfHourOfMoment(moment) { return moment } + export function formatSeconds(value) { + +         var theTime = parseInt(value);// 秒 +         var middle= 0;// 分 +         var hour= 0;// 小时 +      +         if(theTime > 60) { +             middle= parseInt(theTime/60); +             theTime = parseInt(theTime%60); +             if(middle> 60) { +                 hour= parseInt(middle/60); +                 middle= parseInt(middle%60); +             } +         } +         var result = ""+parseInt(theTime)+"秒"; +         if(middle > 0) { + if(hour>0){ + result = ""+parseInt(middle)+"分"; + }else{ + result = ""+parseInt(middle)+"分"+result; + } +              +         } +         if(hour> 0) { +             result = ""+parseInt(hour)+"小时"+result; +         } +         return result; +     } + + export function formatDuring(mss){ var days = parseInt(mss / (1000 * 60 * 60 * 24)); var hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); diff --git a/public/react/src/common/educoder.js b/public/react/src/common/educoder.js index 2cb074a6a..c990b5dea 100644 --- a/public/react/src/common/educoder.js +++ b/public/react/src/common/educoder.js @@ -20,7 +20,7 @@ export { bytesToSize as bytesToSize } from './UnitUtil'; export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll, isImageExtension, downloadFile, sortDirections } from './TextUtil' -export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil' +export { handleDateString, getNextHalfHourOfMoment,formatDuring,formatSeconds} from './DateUtil' export { configShareForIndex, configShareForPaths, configShareForShixuns, configShareForCourses, configShareForCustom } from './util/ShareUtil' diff --git a/public/react/src/modules/courses/Video/Video.js b/public/react/src/modules/courses/Video/Video.js index 1ad16d702..181c082ae 100644 --- a/public/react/src/modules/courses/Video/Video.js +++ b/public/react/src/modules/courses/Video/Video.js @@ -243,7 +243,7 @@ class Video extends Component {

{videoData && videoData.count} 个视频

-

播放数据从2020-03-13 24:00开始统计

+

播放数据从2020-03-13 24:00开始统计

diff --git a/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js b/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js index dd4de7ecd..299af0d08 100644 --- a/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js +++ b/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js @@ -1,6 +1,6 @@ import React, { useState, useEffect, useContext, memo } from 'react'; import { Progress, Input, Tooltip , Spin } from 'antd' -import { getUrl2, isDev, CBreadcrumb, ActionBtn, ThemeContext } from 'educoder' +import { getUrl2, isDev, CBreadcrumb, ActionBtn, ThemeContext,formatSeconds} from 'educoder' import axios from 'axios' import moment from 'moment' import playIcon from './images/play.png' @@ -38,6 +38,7 @@ function VideoInReviewItem (props) { } }, []) + const username = props.match.params.username function toList() { @@ -74,7 +75,9 @@ function VideoInReviewItem (props) { {/*
累计学习时长:{play_duration} h
*/} {/* {moment(published_at || created_at).format('YYYY-MM-DD HH:mm:ss')}{people_num} */} {link ? :累计学习时长:{ - total_time<60?total_time+' s':total_time/60<60?(total_time/60).toFixed(0)+' min':(total_time/60/60).toFixed(1)+ ' h'}} + formatSeconds(total_time)} + {/* total_time<60?total_time+' s':total_time/60<60?(total_time/60).toFixed(0)+' min':(total_time/3600).toFixed(1)+ ' h' */} + }
{/* 2019-09-01 10:00:22 */} From 8db66523b5cbb11b6d67646a8677932d08dd6f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 13 Mar 2020 23:39:35 +0800 Subject: [PATCH 20/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/signin/student/Signedinlist.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/signin/student/Signedinlist.js b/public/react/src/modules/courses/signin/student/Signedinlist.js index 02cd231fc..7c7622783 100644 --- a/public/react/src/modules/courses/signin/student/Signedinlist.js +++ b/public/react/src/modules/courses/signin/student/Signedinlist.js @@ -38,10 +38,10 @@ class Signedinlist extends Component { let {attendanceslist}=this.state; if(this.props.headdata){ let listattendanceslist=attendanceslist; - if(headdata.course_groups){ + if(this.props.headdata.course_groups){ - if(headdata.course_groups.length>0){ - headdata.course_groups.map((item,key)=>{ + if(this.props.headdata.course_groups.length>0){ + this.props.headdata.course_groups.map((item,key)=>{ listattendanceslist.push(item) }) } @@ -49,8 +49,8 @@ class Signedinlist extends Component { this.setState({ listattendanceslist:listattendanceslist, data:response.data, - course_members_count:headdata.all_count, - attendance_count:headdata.normal_count + course_members_count:this.props.headdata.all_count, + attendance_count:this.props.headdata.normal_count }) } From 55b12f66f0604efd2f3887e5c7e7adc3bdac62c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 13 Mar 2020 23:44:31 +0800 Subject: [PATCH 21/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/signin/student/Signedinlist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/signin/student/Signedinlist.js b/public/react/src/modules/courses/signin/student/Signedinlist.js index 7c7622783..e5015a359 100644 --- a/public/react/src/modules/courses/signin/student/Signedinlist.js +++ b/public/react/src/modules/courses/signin/student/Signedinlist.js @@ -48,7 +48,7 @@ class Signedinlist extends Component { } this.setState({ listattendanceslist:listattendanceslist, - data:response.data, + data:this.props.headdata, course_members_count:this.props.headdata.all_count, attendance_count:this.props.headdata.normal_count }) From 0a854db3758a6d8a5436eb22eaba22bf34ed7c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 13 Mar 2020 23:58:04 +0800 Subject: [PATCH 22/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Signinstatistics/Signinstatistics.js | 8 ++-- .../courses/signin/student/Signedinlist.js | 43 +++++++++++-------- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js index 0f84980bc..e6bda13be 100644 --- a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js +++ b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js @@ -101,16 +101,16 @@ class Signinstatistics extends Component { { ` .lishiqiandao{ - background-image: url(${getImageUrl(`/images/qiandao/lishi.png`)}); + background-image: url(${getImageUrl(`images/qiandao/lishi.png`)}); } .daokeqiandao{ - background-image: url(${getImageUrl(`/images/qiandao/daoke.png`)}); + background-image: url(${getImageUrl(`images/qiandao/daoke.png`)}); } .kuangkeqiandao{ - background-image: url(${getImageUrl(`/images/qiandao/kuangke.png`)}); + background-image: url(${getImageUrl(`images/qiandao/kuangke.png`)}); } .qingjiaqiandao{ - background-image: url(${getImageUrl(`/images/qiandao/qingjia.png`)}); + background-image: url(${getImageUrl(`images/qiandao/qingjia.png`)}); } ` } diff --git a/public/react/src/modules/courses/signin/student/Signedinlist.js b/public/react/src/modules/courses/signin/student/Signedinlist.js index e5015a359..490788356 100644 --- a/public/react/src/modules/courses/signin/student/Signedinlist.js +++ b/public/react/src/modules/courses/signin/student/Signedinlist.js @@ -35,31 +35,36 @@ class Signedinlist extends Component { } componentDidMount() { - let {attendanceslist}=this.state; - if(this.props.headdata){ - let listattendanceslist=attendanceslist; - if(this.props.headdata.course_groups){ - - if(this.props.headdata.course_groups.length>0){ - this.props.headdata.course_groups.map((item,key)=>{ - listattendanceslist.push(item) - }) - } - } - this.setState({ - listattendanceslist:listattendanceslist, - data:this.props.headdata, - course_members_count:this.props.headdata.all_count, - attendance_count:this.props.headdata.normal_count - }) - } - this.getdatas(this.props&&this.props.switattendance_id,1,[],undefined) // this.getpath() } + componentDidUpdate(prevProps, prevState) { + if(prevProps.headdata!=this.props.headdata){ + console.log(this.props.headdata) + let {attendanceslist}=this.state; + if(this.props.headdata){ + let listattendanceslist=attendanceslist; + if(this.props.headdata.course_groups){ + + if(this.props.headdata.course_groups.length>0){ + this.props.headdata.course_groups.map((item,key)=>{ + listattendanceslist.push(item) + }) + } + } + this.setState({ + listattendanceslist:listattendanceslist, + data:this.props.headdata, + course_members_count:this.props.headdata.all_count, + attendance_count:this.props.headdata.normal_count + }) + } + + } + } getdatas=(id,page,group_ids,attendance_status)=>{ this.setState({ loading:true, From 6e2887470765b23754b01a16ee57950b7d348943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 14 Mar 2020 00:11:23 +0800 Subject: [PATCH 23/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/signin/student/Signedinlist.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/signin/student/Signedinlist.js b/public/react/src/modules/courses/signin/student/Signedinlist.js index 490788356..8ee3e3a65 100644 --- a/public/react/src/modules/courses/signin/student/Signedinlist.js +++ b/public/react/src/modules/courses/signin/student/Signedinlist.js @@ -102,16 +102,18 @@ class Signedinlist extends Component { neval=[] this.setState({ group_ids: [], + page:1 }) }else{ neval=[value] this.setState({ group_ids: [value], + page:1 }) } let {page,attendance_status}=this.state; - this.getdatas(this.props&&this.props.switattendance_id,page,neval,attendance_status) + this.getdatas(this.props&&this.props.switattendance_id,1,neval,attendance_status) if(this.props.defaultActiveKey==="1"){ this.getpath(value) } @@ -161,16 +163,18 @@ class Signedinlist extends Component { neval=undefined this.setState({ attendance_status:undefined, + page:1 }) }else{ neval=value this.setState({ attendance_status: value, + page:1 }) } let {page,group_ids}=this.state; - this.getdatas(this.props&&this.props.switattendance_id,page,group_ids,neval) + this.getdatas(this.props&&this.props.switattendance_id,1,group_ids,neval) } paginationonChange = (pageNumber) => { this.setState({ From 4629c5d7841080188e7868b61fb678781ef36992 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 14 Mar 2020 00:23:36 +0800 Subject: [PATCH 24/69] =?UTF-8?q?sql=E6=B3=A8=E5=85=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/queries/weapps/subject_query.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/queries/weapps/subject_query.rb b/app/queries/weapps/subject_query.rb index 0a3c9beb2..7c7922a2a 100644 --- a/app/queries/weapps/subject_query.rb +++ b/app/queries/weapps/subject_query.rb @@ -21,7 +21,7 @@ class Weapps::SubjectQuery < ApplicationQuery # 搜索 if params[:keyword].present? - subjects = subjects.where("subjects.name like '%#{params[:keyword]}%'") + subjects = subjects.where("subjects.name like :keyword", keyword: "%#{params[:keyword]}%") end subjects = subjects.left_joins(:shixuns, :repertoire).select('subjects.id, subjects.name, subjects.excellent, subjects.stages_count, subjects.status, subjects.homepage_show, From 8a4e88fdd1cae320f7b0d991544aad3e3274bcc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 14 Mar 2020 00:36:46 +0800 Subject: [PATCH 25/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/signin/Signinstatistics/Signinstatistics.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js index 083582409..ca7ecace4 100644 --- a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js +++ b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js @@ -23,9 +23,7 @@ class Signinstatistics extends Component { } } getdata=(group_id)=>{ - this.setState({ - spal:true - }) + const coursesId=this.props.match.params.coursesId; let url=`/weapps/courses/${coursesId}/attendances.json` axios.get(url,{params:{ @@ -77,6 +75,9 @@ class Signinstatistics extends Component { } componentDidMount() { + this.setState({ + spal:true + }) const coursesId=this.props.match.params.coursesId; let newurl=`/courses/${coursesId}/all_course_groups.json`; axios.get(newurl).then((response) => { From 2491b2d142c66420823641997040969f09f6c178 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 14 Mar 2020 00:40:39 +0800 Subject: [PATCH 26/69] =?UTF-8?q?sql=E6=B3=A8=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/queries/weapps/subject_query.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/queries/weapps/subject_query.rb b/app/queries/weapps/subject_query.rb index 7c7922a2a..d26fad5f4 100644 --- a/app/queries/weapps/subject_query.rb +++ b/app/queries/weapps/subject_query.rb @@ -33,10 +33,10 @@ class Weapps::SubjectQuery < ApplicationQuery private def order_type - params[:order] || "updated_at" + params[:order] == "updated_at" ? "updated_at" : "myshixuns_count" end def sort_type - params[:sort] || "desc" + params[:sort] == "desc" ? "desc" : "asc" end end \ No newline at end of file From b9476a4a23ebb4b91f7d243997759caabcb67ca7 Mon Sep 17 00:00:00 2001 From: harry Date: Sat, 14 Mar 2020 00:44:49 +0800 Subject: [PATCH 27/69] fix /issues/28573 --- public/react/package-lock.json | 15 +++++++++++++++ .../modules/courses/Video/video-play/index.jsx | 7 +++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/public/react/package-lock.json b/public/react/package-lock.json index a22a5a9ea..4cb59a032 100644 --- a/public/react/package-lock.json +++ b/public/react/package-lock.json @@ -13577,6 +13577,21 @@ "resolved": "http://registry.npm.taobao.org/q/download/q-1.5.1.tgz", "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" }, + "qr.js": { + "version": "0.0.0", + "resolved": "https://registry.npm.taobao.org/qr.js/download/qr.js-0.0.0.tgz", + "integrity": "sha1-ys6GOG9ZoNuAUPqQ2baw6IoeNk8=" + }, + "qrcode.react": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/qrcode.react/download/qrcode.react-1.0.0.tgz", + "integrity": "sha1-foiJ2zt2nlVejrRj1MbeIhw21d4=", + "requires": { + "loose-envify": "^1.4.0", + "prop-types": "^15.6.0", + "qr.js": "0.0.0" + } + }, "qs": { "version": "6.7.0", "resolved": "http://registry.npm.taobao.org/qs/download/qs-6.7.0.tgz", diff --git a/public/react/src/modules/courses/Video/video-play/index.jsx b/public/react/src/modules/courses/Video/video-play/index.jsx index cfc5ad343..8c3a2eb20 100644 --- a/public/react/src/modules/courses/Video/video-play/index.jsx +++ b/public/react/src/modules/courses/Video/video-play/index.jsx @@ -111,17 +111,14 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => { log() } } - + //循环播放, 累计时长不能清空 async function onEnded() { log(() => { logId = null - logCount = 1 lastUpdatedTime = 0 - sumTimePlayed = 0 initLog = false isLoging = false isSeeking = false - pos = [] }, true) } @@ -140,6 +137,8 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => { log() } } + }else { + lastUpdatedTime = newTime } } From bac5cb92b6827d04e6249fb9698203ea1d0b5197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 14 Mar 2020 00:49:18 +0800 Subject: [PATCH 28/69] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/paths/ShixunPathSearch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/paths/ShixunPathSearch.js b/public/react/src/modules/paths/ShixunPathSearch.js index 844215974..d445a0c1d 100644 --- a/public/react/src/modules/paths/ShixunPathSearch.js +++ b/public/react/src/modules/paths/ShixunPathSearch.js @@ -30,7 +30,7 @@ class ShixunPathSearch extends Component { //适配器 onChangeLabel(value) { - let rs = value === 'new' ? 'updated_at' : 'myshixuns_scount' + let rs = value === 'new' ? 'updated_at' : 'myshixuns_count' let { discipline_id, sub_discipline_id } = this.state; this.setState({ order: rs, From b24fc4d16c10db25a0b52d98acc115b9f4db6103 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 14 Mar 2020 01:03:22 +0800 Subject: [PATCH 29/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attendances_controller.rb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/controllers/attendances_controller.rb b/app/controllers/attendances_controller.rb index dc30df7e3..f265bd5a3 100644 --- a/app/controllers/attendances_controller.rb +++ b/app/controllers/attendances_controller.rb @@ -11,20 +11,24 @@ class AttendancesController < ApplicationController if params[:history] @attendances = @course.course_attendances.where("attendance_date < '#{current_date}' or (attendance_date = '#{current_date}' and end_time < '#{current_end_time}')") - if @user_course_identity == Course::STUDENT - member = @course.students.find_by(user_id: current_user.id) - group_ids = [member&.course_group_id.to_i, 0] - @attendances = @attendances.joins(:course_attendance_groups).where(course_attendance_groups: {course_group_id: group_ids}) + else + @attendances = @course.course_attendances.where("attendance_date > '#{current_date}' or + (attendance_date = '#{current_date}' and end_time > '#{current_end_time}')") + end + + if @user_course_identity == Course::STUDENT + member = @course.students.find_by(user_id: current_user.id) + group_ids = [member&.course_group_id.to_i, 0] + @attendances = @attendances.joins(:course_attendance_groups).where(course_attendance_groups: {course_group_id: group_ids}) + if params[:history] attendance_ids = @attendances.pluck(:id) @normal_count = @course.course_member_attendances.where(course_member_id: member&.id, course_attendance_id: attendance_ids, attendance_status: "NORMAL").size @leave_count = @course.course_member_attendances.where(course_member_id: member&.id, course_attendance_id: attendance_ids, attendance_status: "LEAVE").size @absence_count = @course.course_member_attendances.where(course_member_id: member&.id, course_attendance_id: attendance_ids, attendance_status: "ABSENCE").size end - else - @attendances = @course.course_attendances.where("attendance_date > '#{current_date}' or - (attendance_date = '#{current_date}' and end_time > '#{current_end_time}')") end + @attendances_count = @attendances.size @attendances = @attendances.order("attendance_date desc, start_time desc") From 8228762cd82bce147bf6ad613bc71c59fad640d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 14 Mar 2020 01:08:16 +0800 Subject: [PATCH 30/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/signin/component/Teacherentry.js | 2 +- .../react/src/modules/courses/signin/student/Signedinlist.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/signin/component/Teacherentry.js b/public/react/src/modules/courses/signin/component/Teacherentry.js index 0f6c8e9ae..1fedde76f 100644 --- a/public/react/src/modules/courses/signin/component/Teacherentry.js +++ b/public/react/src/modules/courses/signin/component/Teacherentry.js @@ -36,7 +36,7 @@ class Teacherentry extends Component {
-

this.props.qiandaoxiangq(true,item.id)}> +

this.props.qiandaoxiangq(true,item.id):""}> { item.name } diff --git a/public/react/src/modules/courses/signin/student/Signedinlist.js b/public/react/src/modules/courses/signin/student/Signedinlist.js index 46c6643c4..ae5410554 100644 --- a/public/react/src/modules/courses/signin/student/Signedinlist.js +++ b/public/react/src/modules/courses/signin/student/Signedinlist.js @@ -219,24 +219,29 @@ class Signedinlist extends Component { title: '序号', dataIndex: 'index', key: 'index', + width:300, className: "textcenter", }, { title: '姓名', dataIndex: 'user_name', key: 'user_name', + width:300, className: "textcenter", }, { title: '学号', dataIndex: 'student_id', key: 'student_id', + width:300, className: "textcenter", }, { title: '状态', key: 'attendance_status', + width:300, dataIndex: 'attendance_status', + className: "textcenter", render: (text, record) => ( this.handleChange(e,record.user_id)}> + + this.handleChange(e,record.user_id)}> { newstate&&newstate.map((item,key)=>{ return( + className={item.name==="正常签到"?"color26C7C9 sginbox":item.name==="请 假"?"colorEAAE4E sginbox":item.name==="旷 课"?"colorFF835C sginbox": item.name ==="未签到"?"color909399 sginbox":""}>{item.name} ) }) } From f2f0a4cbebc14e2a00f542d2d596d0245268fc37 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 14 Mar 2020 16:37:14 +0800 Subject: [PATCH 40/69] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=BD=AC=E7=A0=81=E7=9A=84=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/video_transcode.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/video_transcode.rake b/lib/tasks/video_transcode.rake index 4fb7c17bd..78a8d5c24 100644 --- a/lib/tasks/video_transcode.rake +++ b/lib/tasks/video_transcode.rake @@ -3,14 +3,14 @@ namespace :video_transcode do desc "视频转码成h264" task :submit => :environment do i = [] - Video.where.not(uuid: nil, file_url: nil).where(transcoded: false, status: "published").find_each do |v| + Video.where.not(uuid: nil, file_url: nil).where(transcoded: false).find_each do |v| code_info = AliyunVod::Service.get_meta_code_info(v.uuid) if v.file_url.include?('.mp4') && code_info[:codecnamne]&.include?("h264") v.update(transcoded: true) else puts("uuid: #{v.uuid}") i << "#{v.id}, #{v.file_url}, #{code_info[:codecnamne]}" - AliyunVod::Service.submit_transcode_job(v.uuid, 'a0277c5c0c7458458e171b0cee6ebf5e') + AliyunVod::Service.submit_transcode_job(v.uuid, 'a0277c5c0c7458458e171b0cee6ebf5e') rescue nil end end puts "###########转码个数:#{i.size}" From c362b83d8c78f69033a10dffae6b4372ae8f2ca1 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 14 Mar 2020 16:43:32 +0800 Subject: [PATCH 41/69] =?UTF-8?q?=E8=A7=86=E9=A2=91=E8=BD=AC=E7=A0=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/video_transcode.rake | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/tasks/video_transcode.rake b/lib/tasks/video_transcode.rake index 78a8d5c24..2b4a1eac7 100644 --- a/lib/tasks/video_transcode.rake +++ b/lib/tasks/video_transcode.rake @@ -15,5 +15,6 @@ namespace :video_transcode do end puts "###########转码个数:#{i.size}" puts "###########id,file_url, codecnamne:#{i}" + Video.where(transcoded: false).update_all(transcoded: true) end end \ No newline at end of file From 188d61a654f6fdfa2926b8bc1929da4da13ca944 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 14 Mar 2020 18:49:53 +0800 Subject: [PATCH 42/69] 1 --- app/controllers/courses_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index baf522848..71b6733db 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -119,6 +119,7 @@ class CoursesController < ApplicationController .or(videos.where(videos: {user_id: current_user.id})) .or(videos.where(course_videos: {is_link: true})) @count = videos.count + logger.info("#######count:#{@count}") @videos = paginate videos end From c28189b7d97008130e66b9ecaa1d0f95fe875bae Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 14 Mar 2020 18:56:40 +0800 Subject: [PATCH 43/69] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 71b6733db..0d57253f5 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -114,10 +114,10 @@ class CoursesController < ApplicationController #sql = "left join videos on videos.id=course_videos.video_id AND (videos.transcoded=1 OR videos.user_id = #{current_user.id})" #@videos = paginate videos.joins(sql).includes(video: [user: :user_extension], user: :user_extension) - videos = videos.includes(video: [user: :user_extension],user: :user_extension).select("course_videos.id, course_videos.title, course_videos.link, course_videos.user_id") - videos = videos.where(videos: {transcoded: true}) + videos = videos.includes(video: [user: :user_extension], user: :user_extension).where(videos: {transcoded: true}) .or(videos.where(videos: {user_id: current_user.id})) .or(videos.where(course_videos: {is_link: true})) + .select("course_videos.id, course_videos.title, course_videos.link, course_videos.user_id") @count = videos.count logger.info("#######count:#{@count}") @videos = paginate videos From 2d8cd7be6c6d4b9451c89b10134f92a958c63d2a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 14 Mar 2020 18:57:28 +0800 Subject: [PATCH 44/69] 1 --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 0d57253f5..f24453e27 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -118,7 +118,7 @@ class CoursesController < ApplicationController .or(videos.where(videos: {user_id: current_user.id})) .or(videos.where(course_videos: {is_link: true})) .select("course_videos.id, course_videos.title, course_videos.link, course_videos.user_id") - @count = videos.count + @count = videos.count("videos.id") logger.info("#######count:#{@count}") @videos = paginate videos end From dd948682f15b4dbeb167fd7b039e92ca844b5e81 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 14 Mar 2020 18:58:38 +0800 Subject: [PATCH 45/69] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=BF=BB=E9=A1=B5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index f24453e27..75f088ccc 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -114,7 +114,7 @@ class CoursesController < ApplicationController #sql = "left join videos on videos.id=course_videos.video_id AND (videos.transcoded=1 OR videos.user_id = #{current_user.id})" #@videos = paginate videos.joins(sql).includes(video: [user: :user_extension], user: :user_extension) - videos = videos.includes(video: [user: :user_extension], user: :user_extension).where(videos: {transcoded: true}) + videos = videos.includes(videos: [user: :user_extension], user: :user_extension).where(videos: {transcoded: true}) .or(videos.where(videos: {user_id: current_user.id})) .or(videos.where(course_videos: {is_link: true})) .select("course_videos.id, course_videos.title, course_videos.link, course_videos.user_id") From 4b72766d8385a7de5fcd0a2bdcdc19071219a8ca Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 14 Mar 2020 19:03:08 +0800 Subject: [PATCH 46/69] =?UTF-8?q?=E7=BF=BB=E9=A1=B5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 75f088ccc..db45176b1 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -114,11 +114,11 @@ class CoursesController < ApplicationController #sql = "left join videos on videos.id=course_videos.video_id AND (videos.transcoded=1 OR videos.user_id = #{current_user.id})" #@videos = paginate videos.joins(sql).includes(video: [user: :user_extension], user: :user_extension) - videos = videos.includes(videos: [user: :user_extension], user: :user_extension).where(videos: {transcoded: true}) + videos = videos.joins(:video).select("course_videos.id, course_videos.title, course_videos.link, course_videos.user_id, course_videos.video_id") + videos = videos.where(videos: {transcoded: true}) .or(videos.where(videos: {user_id: current_user.id})) - .or(videos.where(course_videos: {is_link: true})) - .select("course_videos.id, course_videos.title, course_videos.link, course_videos.user_id") - @count = videos.count("videos.id") + .or(videos.where(course_videos: {is_link: true})).includes(video: [user: :user_extension], user: :user_extension) + @count = videos.count("course_videos.id") logger.info("#######count:#{@count}") @videos = paginate videos end From f8da5fc23e9eae635c3e2f78957873d5535d140e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 14 Mar 2020 19:05:22 +0800 Subject: [PATCH 47/69] =?UTF-8?q?=E7=BF=BB=E9=A1=B5=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index db45176b1..c74e4c9dd 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -114,7 +114,7 @@ class CoursesController < ApplicationController #sql = "left join videos on videos.id=course_videos.video_id AND (videos.transcoded=1 OR videos.user_id = #{current_user.id})" #@videos = paginate videos.joins(sql).includes(video: [user: :user_extension], user: :user_extension) - videos = videos.joins(:video).select("course_videos.id, course_videos.title, course_videos.link, course_videos.user_id, course_videos.video_id") + videos = videos.joins(:video).select("course_videos.id, course_videos.title, course_videos.link, course_videos.is_link,course_videos.user_id, course_videos.video_id") videos = videos.where(videos: {transcoded: true}) .or(videos.where(videos: {user_id: current_user.id})) .or(videos.where(course_videos: {is_link: true})).includes(video: [user: :user_extension], user: :user_extension) From 8927ac0bfbb9634675928ab035115c1f55ee3c4d Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 14 Mar 2020 19:21:53 +0800 Subject: [PATCH 48/69] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0200313104522_add_total_duration_to_watch_course_duration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20200313104522_add_total_duration_to_watch_course_duration.rb b/db/migrate/20200313104522_add_total_duration_to_watch_course_duration.rb index 400e52ac8..4cffb4d33 100644 --- a/db/migrate/20200313104522_add_total_duration_to_watch_course_duration.rb +++ b/db/migrate/20200313104522_add_total_duration_to_watch_course_duration.rb @@ -1,6 +1,6 @@ class AddTotalDurationToWatchCourseDuration < ActiveRecord::Migration[5.2] def change - add_column :watch_course_videos, :total_duration, :float, default: 0 + #add_column :watch_course_videos, :total_duration, :float, default: 0 WatchVideoHistory.where("created_at < '2020-03-14 00:00:00'").each do |d| d.watch_course_video.increment!(:total_duration, d.total_duration) if d.watch_course_video.present? end From a7f40632a92b5c60fe7b2930c5280d26db79591e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 14 Mar 2020 19:24:59 +0800 Subject: [PATCH 49/69] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...313104522_add_total_duration_to_watch_course_duration.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/migrate/20200313104522_add_total_duration_to_watch_course_duration.rb b/db/migrate/20200313104522_add_total_duration_to_watch_course_duration.rb index 4cffb4d33..741be91f5 100644 --- a/db/migrate/20200313104522_add_total_duration_to_watch_course_duration.rb +++ b/db/migrate/20200313104522_add_total_duration_to_watch_course_duration.rb @@ -1,8 +1,8 @@ class AddTotalDurationToWatchCourseDuration < ActiveRecord::Migration[5.2] def change #add_column :watch_course_videos, :total_duration, :float, default: 0 - WatchVideoHistory.where("created_at < '2020-03-14 00:00:00'").each do |d| - d.watch_course_video.increment!(:total_duration, d.total_duration) if d.watch_course_video.present? - end + #WatchVideoHistory.where("created_at < '2020-03-14 00:00:00'").each do |d| + # d.watch_course_video.increment!(:total_duration, d.total_duration) if d.watch_course_video.present? + #end end end From de6a53be9e43d757aa5a2fb49a9c24fef421fc0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 14 Mar 2020 20:02:54 +0800 Subject: [PATCH 50/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index baf522848..72fb8d719 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1297,8 +1297,8 @@ class CoursesController < ApplicationController def left_banner @user = current_user @is_teacher = @user_course_identity < Course::ASSISTANT_PROFESSOR - @course_modules = @course.course_modules.where.not(module_type: 'attendance').where(hidden: 0).includes(first_categories: :children) - @hidden_modules = @course.course_modules.where(hidden: 1) + @course_modules = @course.course_modules.where(hidden: 0).includes(first_categories: :children) + @hidden_modules = @course.course_modules.where.not(module_type: 'attendance').where(hidden: 1) @second_category_type = ["shixun_homework", "graduation", "attachment", "board", "course_group", "video", "common_homework", "group_homework"] end From 30082cc0127543318af5ec88765d89b9c3a8afce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 14 Mar 2020 20:08:43 +0800 Subject: [PATCH 51/69] =?UTF-8?q?=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 72fb8d719..d701575e7 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1298,7 +1298,7 @@ class CoursesController < ApplicationController @user = current_user @is_teacher = @user_course_identity < Course::ASSISTANT_PROFESSOR @course_modules = @course.course_modules.where(hidden: 0).includes(first_categories: :children) - @hidden_modules = @course.course_modules.where.not(module_type: 'attendance').where(hidden: 1) + @hidden_modules = @course.course_modules.where(hidden: 1) @second_category_type = ["shixun_homework", "graduation", "attachment", "board", "course_group", "video", "common_homework", "group_homework"] end From ba2e65b086b653fe06f9cf6d7a3059c0b742999d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 14 Mar 2020 20:30:15 +0800 Subject: [PATCH 52/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attendances_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/attendances_controller.rb b/app/controllers/attendances_controller.rb index 6e159cd77..c8287f413 100644 --- a/app/controllers/attendances_controller.rb +++ b/app/controllers/attendances_controller.rb @@ -34,7 +34,10 @@ class AttendancesController < ApplicationController @normal_count = @course.course_member_attendances.where(course_member_id: member&.id, course_attendance_id: attendance_ids, attendance_status: "NORMAL").size @leave_count = @course.course_member_attendances.where(course_member_id: member&.id, course_attendance_id: attendance_ids, attendance_status: "LEAVE").size @absence_count = @course.course_member_attendances.where(course_member_id: member&.id, course_attendance_id: attendance_ids, attendance_status: "ABSENCE").size + else + @attendances = @attendances.where("attendance_date = '#{current_date}' and start_time <= '#{current_end_time}' and end_time > '#{current_end_time}'") end + end @attendances_count = @attendances.size From 35b8a229bd9059961a06fb257b18662eb967a485 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 14 Mar 2020 21:49:22 +0800 Subject: [PATCH 53/69] =?UTF-8?q?=E5=88=86=E7=8F=AD=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=9A=84=E7=AD=BE=E5=88=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/weapps/attendances_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/weapps/attendances_controller.rb b/app/controllers/weapps/attendances_controller.rb index 9740da15f..90f8c24b6 100644 --- a/app/controllers/weapps/attendances_controller.rb +++ b/app/controllers/weapps/attendances_controller.rb @@ -9,8 +9,10 @@ class Weapps::AttendancesController < ApplicationController def create ActiveRecord::Base.transaction do attendance = @course.course_attendances.create!(create_params.merge(user_id: current_user.id)) - unless params[:group_ids].blank? || @course.course_groups.where(id: params[:group_ids]).count == @course.course_groups.count - group_ids = @course.charge_group_ids(current_user) & params[:group_ids].map(&:to_i) + group_ids = params[:group_ids] || [] + group_ids = group_ids.blank? ? @course.charge_group_ids(current_user) : @course.charge_group_ids(current_user) & params[:group_ids].map(&:to_i) + unless group_ids.blank? || @course.course_groups.where(id: group_ids).count == @course.course_groups.count + # group_ids = @course.charge_group_ids(current_user) & params[:group_ids].map(&:to_i) group_ids.each do |group_id| @course.course_attendance_groups.create!(course_group_id: group_id, course_attendance: attendance) end From f1d262847ff1692a416453190e7ea93338b704d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 14 Mar 2020 22:00:36 +0800 Subject: [PATCH 54/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/signin/student/Signedinlist.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/courses/signin/student/Signedinlist.js b/public/react/src/modules/courses/signin/student/Signedinlist.js index 16e4c3865..5885e8a67 100644 --- a/public/react/src/modules/courses/signin/student/Signedinlist.js +++ b/public/react/src/modules/courses/signin/student/Signedinlist.js @@ -14,7 +14,7 @@ class Signedinlist extends Component { limit:5, page:1, loading:false, - attendanceslist:[{id:undefined,name:"全部分班"}], + attendanceslist:[], data:null, group_ids:[], members_count:0, @@ -42,9 +42,9 @@ class Signedinlist extends Component { componentDidUpdate(prevProps, prevState) { if(prevProps.headdata!=this.props.headdata){ - let {attendanceslist}=this.state; if(this.props.headdata){ - let listattendanceslist=attendanceslist; + let listattendanceslist=[]; + listattendanceslist.push({id:undefined,name:"全部分班"}) if(this.props.headdata.course_groups){ if(this.props.headdata.course_groups.length>0){ @@ -54,7 +54,7 @@ class Signedinlist extends Component { } } this.setState({ - listattendanceslist:listattendanceslist, + attendanceslist:listattendanceslist, data:this.props.headdata, course_members_count:this.props.headdata.normal_count, attendance_count:this.props.headdata.all_count @@ -126,7 +126,7 @@ class Signedinlist extends Component { let url=`/weapps/attendances/${this.props&&this.props.switattendance_id}.json`; axios.get(url).then((response) => { if(response.data){ - + listattendanceslist.push({id:undefined,name:"全部分班"}) if(response.data.course_groups.length>0){ response.data.course_groups.map((item,key)=>{ listattendanceslist.push(item) @@ -149,7 +149,7 @@ class Signedinlist extends Component { }) } this.setState({ - listattendanceslist:listattendanceslist, + attendanceslist:listattendanceslist, data:response.data }) From b8358e913de84d7e09c6596120cd0ba45373cecc Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 14 Mar 2020 22:00:52 +0800 Subject: [PATCH 55/69] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/weapps/shixun_search_service.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/services/weapps/shixun_search_service.rb b/app/services/weapps/shixun_search_service.rb index 448bb1992..7e0310542 100644 --- a/app/services/weapps/shixun_search_service.rb +++ b/app/services/weapps/shixun_search_service.rb @@ -34,8 +34,7 @@ class Weapps::ShixunSearchService < ApplicationService unless params[:keyword].blank? keyword = params[:keyword].strip shixuns = shixuns.joins(:user). - where("concat(lastname, firstname) like :keyword or shixuns.name like :keyword", - keyword: "%#{keyword}%", name: "%#{keyword.split(" ").join("%")}%").distinct + where("shixuns.name like :keyword", keyword: "%#{keyword}%").distinct end shixuns.order("#{sort_str} #{order_str}") From 741d6307537e6510e3b23a665f0dd02c427fb24d Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 14 Mar 2020 22:18:15 +0800 Subject: [PATCH 56/69] =?UTF-8?q?=E6=8C=89name=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/weapps/shixun_search_service.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/weapps/shixun_search_service.rb b/app/services/weapps/shixun_search_service.rb index 7e0310542..c45585093 100644 --- a/app/services/weapps/shixun_search_service.rb +++ b/app/services/weapps/shixun_search_service.rb @@ -34,7 +34,8 @@ class Weapps::ShixunSearchService < ApplicationService unless params[:keyword].blank? keyword = params[:keyword].strip shixuns = shixuns.joins(:user). - where("shixuns.name like :keyword", keyword: "%#{keyword}%").distinct + where("concat(lastname, firstname) like :keyword or shixuns.name like :keyword", + keyword: "%#{keyword}%", name: "%#{keyword.split(" ").join("%")}%").distinct end shixuns.order("#{sort_str} #{order_str}") From 327c856463018797ce1beb48e87558dd5109d282 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 14 Mar 2020 22:33:14 +0800 Subject: [PATCH 57/69] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/weapps/shixun_search_service.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/services/weapps/shixun_search_service.rb b/app/services/weapps/shixun_search_service.rb index 448bb1992..e44943b1e 100644 --- a/app/services/weapps/shixun_search_service.rb +++ b/app/services/weapps/shixun_search_service.rb @@ -38,7 +38,14 @@ class Weapps::ShixunSearchService < ApplicationService keyword: "%#{keyword}%", name: "%#{keyword.split(" ").join("%")}%").distinct end - shixuns.order("#{sort_str} #{order_str}") + order = + if sort_str == "wechat_myshixuns_count" + "is_wechat_support desc, myshixuns_count #{order_str}" + else + "#{sort_str} #{order_str}" + end + + shixuns.order(order) end private From f8cf7228a72f04bf8afaac41b65697a15157dd07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 14 Mar 2020 22:33:24 +0800 Subject: [PATCH 58/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/signin/css/Signinstatistics.css | 1 + .../src/modules/courses/signin/teacher/Teachers_signin.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/signin/css/Signinstatistics.css b/public/react/src/modules/courses/signin/css/Signinstatistics.css index 060793bc6..388f0ad28 100644 --- a/public/react/src/modules/courses/signin/css/Signinstatistics.css +++ b/public/react/src/modules/courses/signin/css/Signinstatistics.css @@ -103,6 +103,7 @@ text-align: right; margin-right: 20px; line-height: 32px; + height: 32px; } #form_in_modal_group_ids .ant-select-selection{ diff --git a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js index ae2507887..bce0a4237 100644 --- a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js +++ b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js @@ -353,10 +353,10 @@ class Students_signin extends Component{ { isAdmin===true? - + />:""} : "" From c83bf14b872e82bb1b2b6eb68ca896850fe9dd70 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 14 Mar 2020 22:37:18 +0800 Subject: [PATCH 59/69] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/weapps/shixun_lists/index.json.jbuilder | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/weapps/shixun_lists/index.json.jbuilder b/app/views/weapps/shixun_lists/index.json.jbuilder index fac238f45..10b66fdfa 100644 --- a/app/views/weapps/shixun_lists/index.json.jbuilder +++ b/app/views/weapps/shixun_lists/index.json.jbuilder @@ -5,5 +5,6 @@ json.shixun_list @results do |obj| json.study_count obj.myshixuns_count json.author_name obj.user.real_name json.author_img url_to_avatar(obj.user) + json.pic url_to_avatar(obj) end json.shixuns_count @total_count \ No newline at end of file From 1c714de914757eeaa51d1f4a22388d06ba0c5c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 14 Mar 2020 23:42:48 +0800 Subject: [PATCH 60/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Signinstatistics/Signinstatistics.js | 21 ++++++++++++------- .../courses/signin/css/Signinstatistics.css | 8 +++++-- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js index ca7ecace4..ca3e0286a 100644 --- a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js +++ b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js @@ -38,19 +38,23 @@ class Signinstatistics extends Component { if(response.data.history_attendances.length>0){ response.data.history_attendances.map((item,key)=>{ newlists.push({ - month: item.index, + // month: item.index, + // month: item.name+" "+item.attendance_date+" "+item.start_time+"-"+item.end_time, + month:item.name, city:"到课率", - temperature: (item.normal_rate).toFixed(0) + temperature: (item.normal_rate*100).toFixed(0) }) newlists.push({ - month: item.index, + //month: item.index, + month:item.name, city: "旷课率", - temperature: (item.absence_rate).toFixed(0) + temperature: (item.absence_rate*100).toFixed(0) }) newlists.push({ - month: item.index, + //month: item.index, + month:item.name, city: "请假率", - temperature: (item.leave_rate).toFixed(0) + temperature: (item.leave_rate*100).toFixed(0) }) }) } @@ -101,8 +105,9 @@ class Signinstatistics extends Component { let {datas,newlist,course_groups,spal}=this.state; const cols = { - month: { - range: [0, 1] + temperature: { + type: 'log', + base: 10 } }; diff --git a/public/react/src/modules/courses/signin/css/Signinstatistics.css b/public/react/src/modules/courses/signin/css/Signinstatistics.css index 388f0ad28..f179e80af 100644 --- a/public/react/src/modules/courses/signin/css/Signinstatistics.css +++ b/public/react/src/modules/courses/signin/css/Signinstatistics.css @@ -102,8 +102,12 @@ color: rgba(153,153,153,1); text-align: right; margin-right: 20px; - line-height: 32px; - height: 32px; + line-height: 32px !important; + height: 32px !important; +} +.ant-select-selection--single .ant-select-selection__rendered{ + line-height: 32px !important; + height: 32px !important; } #form_in_modal_group_ids .ant-select-selection{ From e64cdf148d7f4c209e8bbbc4bfb8bd27b2196ac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 14 Mar 2020 23:59:28 +0800 Subject: [PATCH 61/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/signin/Signinstatistics/Signinstatistics.js | 2 +- .../react/src/modules/courses/signin/css/Signinstatistics.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js index ca3e0286a..9eedb8e3e 100644 --- a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js +++ b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js @@ -195,7 +195,7 @@ class Signinstatistics extends Component { 显示最近十次签到 - this.handleChange(e)} style={{width:"130px"}} className={"Signinstatisticsfontselect"}> {course_groups&&course_groups.map((item,key)=>{ return( diff --git a/public/react/src/modules/courses/signin/css/Signinstatistics.css b/public/react/src/modules/courses/signin/css/Signinstatistics.css index f179e80af..298ef9403 100644 --- a/public/react/src/modules/courses/signin/css/Signinstatistics.css +++ b/public/react/src/modules/courses/signin/css/Signinstatistics.css @@ -105,7 +105,7 @@ line-height: 32px !important; height: 32px !important; } -.ant-select-selection--single .ant-select-selection__rendered{ +.Signinstatisticsfontselect .ant-select-selection--single .ant-select-selection__rendered{ line-height: 32px !important; height: 32px !important; } From 70807c84191a47ac814f9c10d1aff6fac1f106b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sun, 15 Mar 2020 00:24:22 +0800 Subject: [PATCH 62/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Signinstatistics/Signinstatistics.js | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js index 9eedb8e3e..a19eb05c8 100644 --- a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js +++ b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js @@ -38,21 +38,23 @@ class Signinstatistics extends Component { if(response.data.history_attendances.length>0){ response.data.history_attendances.map((item,key)=>{ newlists.push({ - // month: item.index, - // month: item.name+" "+item.attendance_date+" "+item.start_time+"-"+item.end_time, - month:item.name, + month: item.index, + name: item.name+" "+item.attendance_date+" "+item.start_time+"-"+item.end_time, + // month:item.name, city:"到课率", temperature: (item.normal_rate*100).toFixed(0) }) newlists.push({ - //month: item.index, - month:item.name, + month: item.index, + name: item.name+" "+item.attendance_date+" "+item.start_time+"-"+item.end_time, + // month:item.name, city: "旷课率", temperature: (item.absence_rate*100).toFixed(0) }) newlists.push({ - //month: item.index, - month:item.name, + month: item.index, + name: item.name+" "+item.attendance_date+" "+item.start_time+"-"+item.end_time, + // month:item.name, city: "请假率", temperature: (item.leave_rate*100).toFixed(0) }) @@ -105,6 +107,9 @@ class Signinstatistics extends Component { let {datas,newlist,course_groups,spal}=this.state; const cols = { + month:{ + range: [0, 1] + }, temperature: { type: 'log', base: 10 @@ -229,6 +234,14 @@ class Signinstatistics extends Component { // color={"city"} shape={"smooth"} color={["city", ["#26C7C9", "#FF835C","#EDBA6F"]]} + tooltip={['name*temperature*city', (name, temperature,city) => { + return { + //自定义 tooltip 上显示的 title 显示内容等。 + name: city, + title: name, + value: temperature+"%" + }; + }]} /> { + // return { + // //自定义 tooltip 上显示的 title 显示内容等。 + // name: 'sold1', + // title: 'dddd' + month, + // value: temperature + // }; + // }]} />

From 9451a751f722f34c90c63ae7d7e8d757753c5ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sun, 15 Mar 2020 00:31:14 +0800 Subject: [PATCH 63/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/signin/Signinstatistics/Signinstatistics.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js index a19eb05c8..d01bccbf1 100644 --- a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js +++ b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js @@ -107,9 +107,6 @@ class Signinstatistics extends Component { let {datas,newlist,course_groups,spal}=this.state; const cols = { - month:{ - range: [0, 1] - }, temperature: { type: 'log', base: 10 From d030cbe859b341c8a701df9a9dc183c987b712bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sun, 15 Mar 2020 00:48:39 +0800 Subject: [PATCH 64/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../signin/Signinstatistics/Signinstatistics.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js index d01bccbf1..b761cf249 100644 --- a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js +++ b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js @@ -107,9 +107,17 @@ class Signinstatistics extends Component { let {datas,newlist,course_groups,spal}=this.state; const cols = { - temperature: { - type: 'log', - base: 10 + month: { + type: 'linear', + nice:[1,10], + min:1, + minLimit:1, + minTickInterval:2 + }, + temperature:{ + type: 'linear', + nice:[0,100], + minTickInterval:2 } }; From 4c4fc1c37436bcba9a452d34db910384fb2180df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sun, 15 Mar 2020 01:30:55 +0800 Subject: [PATCH 65/69] =?UTF-8?q?=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/signin/component/Detailss.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/signin/component/Detailss.js b/public/react/src/modules/courses/signin/component/Detailss.js index f109db317..d205ffdcb 100644 --- a/public/react/src/modules/courses/signin/component/Detailss.js +++ b/public/react/src/modules/courses/signin/component/Detailss.js @@ -118,9 +118,11 @@ class Detailss extends Component {
{ defaultActiveKey === "1" ? -
{ item && item.mode === "NUMBER" ? From 58dde3826b074af190ef08a1bf34e24a5e896832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sun, 15 Mar 2020 01:42:36 +0800 Subject: [PATCH 66/69] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../signin/Signinstatistics/Signinstatistics.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js index b761cf249..0be54a6b7 100644 --- a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js +++ b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js @@ -3,6 +3,7 @@ import React,{ Component } from "react"; import { Row, Col,Card,Select} from 'antd'; import {getImageUrl} from 'educoder'; import axios from 'axios'; +import NoneDatas from "../component/NoneDatas"; import { Chart, Geom, @@ -17,7 +18,7 @@ class Signinstatistics extends Component { super(props) this.state={ datas:null, - newlist:[], + newlist:undefined, course_groups:[{id:"全部",name:"全部"}], spal:false, } @@ -177,7 +178,7 @@ class Signinstatistics extends Component { -
+ {newlist&&newlist.length>0?
@@ -218,7 +219,7 @@ class Signinstatistics extends Component {
- + {/**/}
-
+
:
+ +
}
}
From af704722a5ce9b955250b7ee3000df4c2561997a Mon Sep 17 00:00:00 2001 From: dinglink <837816638@qq.com> Date: Sun, 15 Mar 2020 12:19:28 +0800 Subject: [PATCH 67/69] =?UTF-8?q?=E9=83=A8=E5=88=86=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/paths/ShixunPathSearch.js | 4 ++-- .../react/src/modules/tpm/shixuns/shixun-search-bar/index.jsx | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/paths/ShixunPathSearch.js b/public/react/src/modules/paths/ShixunPathSearch.js index 844215974..ce3aac409 100644 --- a/public/react/src/modules/paths/ShixunPathSearch.js +++ b/public/react/src/modules/paths/ShixunPathSearch.js @@ -170,7 +170,7 @@ class ShixunPathSearch extends Component {
{ list.map((tag, e) => { - return ( + return ( this.getshixunchildValues(e, tag.id, item)}>{tag.name} ) @@ -242,7 +242,7 @@ class ShixunPathSearch extends Component { sortList && sortList.map((item, key) => { return (
  • this.changeSelect(e, `${item.id}`, item.sub_disciplines.length)} key={key}> - this.getmenu(item.sub_disciplines, item)} placement="bottomCenter"> + this.getmenu(item.sub_disciplines, item)} placement="bottomLeft"> {item.name}
  • diff --git a/public/react/src/modules/tpm/shixuns/shixun-search-bar/index.jsx b/public/react/src/modules/tpm/shixuns/shixun-search-bar/index.jsx index c936de66d..8a0387581 100644 --- a/public/react/src/modules/tpm/shixuns/shixun-search-bar/index.jsx +++ b/public/react/src/modules/tpm/shixuns/shixun-search-bar/index.jsx @@ -84,6 +84,7 @@ export default ({ StatusEnquiry, allUpdatashixunlist, Updatasearchlist }) => { } init() }, []) + // item.id < 4 ? "bottomRight" : item.id >= 8 ? "bottomLeft" : "bottomCenter" return (
    @@ -95,7 +96,7 @@ export default ({ StatusEnquiry, allUpdatashixunlist, Updatasearchlist }) => { { navs.map((item, key) => { return ( - = 8 ? "bottomLeft" : "bottomCenter"}> +
  • {item.name}
  • From 89991140296c1d3be3a21fefb99f65e792f7b8af Mon Sep 17 00:00:00 2001 From: dinglink <837816638@qq.com> Date: Sun, 15 Mar 2020 14:25:37 +0800 Subject: [PATCH 68/69] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=8F=8A=E6=98=BE=E7=A4=BA=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/Listofworksstudentone.js | 10 +++++----- .../modules/courses/signin/teacher/Teachers_signin.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index d83f51c0a..833cdf307 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -1061,14 +1061,14 @@ class Listofworksstudentone extends Component { }> {record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time === "--" ? "--" : - {record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time} - + } // this.Viewstudenttraininginformationt(record)} >{record.has_comment===true?"详情":"评阅 "} : - this.Viewstudenttraininginformationtysl2(e, record)} // onClick={() => this.Viewstudenttraininginformationt(record)} >{record.has_comment===true?"详情":"评阅 "} @@ -1446,14 +1446,14 @@ class Listofworksstudentone extends Component { } }> {record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time === "--" ? "--" : - {record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time} - + } ) diff --git a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js index bce0a4237..4f9ecb732 100644 --- a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js +++ b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js @@ -307,9 +307,9 @@ class Students_signin extends Component{
    - 0? + total={attendances_count}>:''}
    @@ -345,10 +345,10 @@ class Students_signin extends Component{
    - 0? -
    + total={attendances_count}>:'' + }
    { isAdmin===true? From 2057beb416fd42d847a10506d05c2896d8996054 Mon Sep 17 00:00:00 2001 From: dinglink <837816638@qq.com> Date: Sun, 15 Mar 2020 15:13:53 +0800 Subject: [PATCH 69/69] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/tpm/shixuns/shixun-search-bar/index.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/shixuns/shixun-search-bar/index.jsx b/public/react/src/modules/tpm/shixuns/shixun-search-bar/index.jsx index 8a0387581..c58ae81aa 100644 --- a/public/react/src/modules/tpm/shixuns/shixun-search-bar/index.jsx +++ b/public/react/src/modules/tpm/shixuns/shixun-search-bar/index.jsx @@ -62,7 +62,7 @@ export default ({ StatusEnquiry, allUpdatashixunlist, Updatasearchlist }) => { return { item.map((list, k) => -
    +
    {list.name}
    { @@ -96,7 +96,7 @@ export default ({ StatusEnquiry, allUpdatashixunlist, Updatasearchlist }) => { { navs.map((item, key) => { return ( - +
  • {item.name}