Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_forum
SylorHuang 5 years ago
commit 9e37b91e45

@ -993,7 +993,7 @@ class CoursesController < ApplicationController
end end
rescue Exception => e rescue Exception => e
uid_logger_error(e.message) uid_logger_error(e.message)
tip_exception("没有权限") tip_exception(e.message)
raise ActiveRecord::Rollback raise ActiveRecord::Rollback
end end
end end
@ -1063,15 +1063,11 @@ class CoursesController < ApplicationController
AND homework_commons.course_id = #{@course.id} AND homework_commons.course_id = #{@course.id}
AND student_works.user_id = cm.user_id AND student_works.user_id = cm.user_id
) AS score, ) AS score,
(SELECT SUM(gw.work_score) FROM graduation_works gw,graduation_tasks gt WHERE gw.graduation_task_id = gt.id
AND gt.course_id = #{@course.id} AND gw.user_id = cm.user_id) AS graduation_score,
(SELECT SUM(exercise_users.score) FROM exercise_users,exercises WHERE exercise_users.exercise_id = exercises.id
AND exercises.course_id = #{@course.id} AND exercise_users.user_id = cm.user_id) AS ex_score,
(SELECT max(student_id) FROM user_extensions WHERE user_extensions.user_id = cm.user_id) AS student_id, (SELECT max(student_id) FROM user_extensions WHERE user_extensions.user_id = cm.user_id) AS student_id,
(SELECT max(message_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = cm.user_id) AS message_num, (SELECT count(messages.id) FROM messages join boards on messages.board_id = boards.id WHERE boards.course_id = #{@course.id} AND messages.author_id = cm.user_id and messages.parent_id is null) AS message_num,
(SELECT max(message_reply_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = cm.user_id) AS message_reply_num, (SELECT count(messages.id) FROM messages join boards on messages.board_id = boards.id WHERE boards.course_id = #{@course.id} AND messages.author_id = cm.user_id and messages.parent_id is not null) AS message_reply_num,
(SELECT max(resource_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = cm.user_id) AS resource_num, (SELECT count(attachments.id) FROM attachments WHERE container_id = #{@course.id} and container_type = "Course" AND attachments.author_id = cm.user_id) AS resource_num,
(SELECT max(homework_journal_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = cm.user_id) AS homework_journal_num, (SELECT count(jfm.id) FROM journals_for_messages AS jfm, homework_commons hs WHERE jfm.jour_id = hs.id AND jfm.user_id = cm.user_id and jfm.jour_type = "HomeworkCommon" and hs.course_id = #{@course.id}) AS homework_journal_num,
(SELECT COUNT(gw.id) FROM graduation_works AS gw, graduation_tasks AS gt WHERE gw.graduation_task_id = gt.id AND gt.course_id = #{@course.id} AND gw.work_status != 0 AND gw.user_id = cm.user_id) AS graduation_num, (SELECT COUNT(gw.id) FROM graduation_works AS gw, graduation_tasks AS gt WHERE gw.graduation_task_id = gt.id AND gt.course_id = #{@course.id} AND gw.work_status != 0 AND gw.user_id = cm.user_id) AS graduation_num,
(SELECT COUNT(ss.id) FROM student_works AS ss ,homework_commons AS hc WHERE ss.homework_common_id = hc.id AND hc.course_id = #{@course.id} AND ss.work_status != 0 AND ss.user_id = cm.user_id) AS homework_num, (SELECT COUNT(ss.id) FROM student_works AS ss ,homework_commons AS hc WHERE ss.homework_common_id = hc.id AND hc.course_id = #{@course.id} AND ss.work_status != 0 AND ss.user_id = cm.user_id) AS homework_num,
(SELECT COUNT(eu.id) FROM exercise_users AS eu,exercises WHERE eu.exercise_id = exercises.id AND exercises.course_id = #{@course.id} AND eu.commit_status = 1 AND eu.user_id = cm.user_id) AS exercise_num, (SELECT COUNT(eu.id) FROM exercise_users AS eu,exercises WHERE eu.exercise_id = exercises.id AND exercises.course_id = #{@course.id} AND eu.commit_status = 1 AND eu.user_id = cm.user_id) AS exercise_num,
@ -1166,7 +1162,7 @@ class CoursesController < ApplicationController
user_login = user.login user_login = user.login
user_name = user.real_name user_name = user.real_name
user_mail = user.mail user_mail = user.mail
user_stu_id = user.student_id.present? ? (user.student_id.to_s + "\t") : "--" user_stu_id = u.student_id.present? ? (u.student_id.to_s + "\t") : "--"
user_course_group = u.course_group_name user_course_group = u.course_group_name
user_info_array = [user_login,user_name,user_mail,user_stu_id,user_course_group] #用户的信息集合 user_info_array = [user_login,user_name,user_mail,user_stu_id,user_course_group] #用户的信息集合
user_work_scores = [] user_work_scores = []

Loading…
Cancel
Save