From 1e0c2e5d6ad17eed4744c464abf6643176269151 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 10 Nov 2016 17:28:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E9=A6=96=E9=A1=B5=E7=9A=84?= =?UTF-8?q?=E6=B4=BB=E8=B7=83=E5=BA=A6=E5=92=8C=E8=8B=B1=E9=9B=84=E6=A6=9C?= =?UTF-8?q?=E7=94=B13=E4=B8=AA=E5=A2=9E=E5=8A=A0=E5=88=B06=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 37c4c037c..52dc9e5c4 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -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 #用户在该课程是否具有某个角色