英雄榜数据显示问题

This commit is contained in:
huang 2016-03-18 14:16:23 +08:00
parent 51bd745b8d
commit bff20ee072
1 changed files with 1 additions and 1 deletions

View File

@ -865,7 +865,7 @@ module CoursesHelper
# 学生按作业总分排序取前8个
def hero_homework_score(course, score_sort_by)
sql_select = "SELECT members.*,(
SELECT SUM(IF(student_works.final_score is null,null,student_works.final_score - student_works.absence_penalty - student_works.late_penalty))
SELECT SUM(IF(student_works.final_score is null,null,IF(student_works.final_score = 0, 0, student_works.final_score - student_works.absence_penalty - student_works.late_penalty)))
FROM student_works,homework_commons
WHERE student_works.homework_common_id = homework_commons.id
AND homework_commons.course_id = #{course.id}