班级首页的活跃度和英雄榜由3个增加到6个
This commit is contained in:
parent
4a5e350615
commit
1e0c2e5d6a
|
@ -895,7 +895,7 @@ module CoursesHelper
|
|||
desc.html_safe
|
||||
end
|
||||
|
||||
# 学生按作业总分排序,取前3个
|
||||
# 学生按作业总分排序,取前6个
|
||||
def hero_homework_score(course, score_sort_by)
|
||||
sql_select = "SELECT members.*,(
|
||||
SELECT SUM(work_score)
|
||||
|
@ -907,14 +907,14 @@ module CoursesHelper
|
|||
FROM members
|
||||
JOIN students_for_courses
|
||||
ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id
|
||||
WHERE members.course_id = #{course.id} ORDER BY score #{score_sort_by} limit 3"
|
||||
WHERE members.course_id = #{course.id} ORDER BY score #{score_sort_by} limit 6"
|
||||
homework_scores = Member.find_by_sql(sql_select)
|
||||
end
|
||||
|
||||
def contributor_course_scor(course_id)
|
||||
ccs = CourseContributorScore.find_by_sql("SELECT * FROM `course_contributor_scores` where course_id = #{course_id} order by
|
||||
(message_num*2 + message_reply_num + news_reply_num + news_num +
|
||||
resource_num*5 + journal_num + homework_journal_num ) desc limit 3;")
|
||||
resource_num*5 + journal_num + homework_journal_num ) desc limit 6;")
|
||||
end
|
||||
|
||||
#用户在该课程是否具有某个角色
|
||||
|
|
Loading…
Reference in New Issue