Merge branch 'szzh' into develop
This commit is contained in:
commit
7dd87212a4
|
@ -734,10 +734,9 @@ class CoursesService
|
|||
user_list = []
|
||||
max_size = 0
|
||||
if params[:type] == 1
|
||||
homework_count = Course.find(params[:course_id]).homework_commons.count
|
||||
|
||||
sql = "select users.*,sum(IFNULL(0,student_works.final_score))/#{homework_count} score from student_works left outer join users on student_works.user_id = users.id" <<
|
||||
" where homework_common_id in ( select id from homework_commons where homework_commons.course_id = #{params[:course_id]}) GROUP BY student_works.user_id ORDER BY score limit #{page*10},10"
|
||||
sql = "select users.*,sum(student_works.final_score) score from student_works left outer join users on student_works.user_id = users.id" <<
|
||||
" where homework_common_id in ( select id from homework_commons where homework_commons.course_id = #{params[:course_id]}) GROUP BY student_works.user_id ORDER BY score desc limit #{page*10},10"
|
||||
sql_count = " select count(distinct(student_works.user_id) ) " <<
|
||||
" from student_works left outer join users on student_works.user_id = users.id " <<
|
||||
" where homework_common_id in " <<
|
||||
|
|
Loading…
Reference in New Issue