|
|
|
@ -140,6 +140,7 @@ class CollegesController < ApplicationController
|
|
|
|
|
course[:task_count] = course.hcm_count.to_i + course.attachments_count.to_i + course.messages_count.to_i + course.hcm_nonshixun_count.to_i + course.exercises_count.to_i + course.polls_count.to_i
|
|
|
|
|
end
|
|
|
|
|
@courses = @courses.sort{|x,y| [y[:evaluating_count], y[:task_count]] <=> [x[:evaluating_count], x[:task_count]] }
|
|
|
|
|
@courses = @courses.sort_by { |course| course.is_end ? 1 : 0 }
|
|
|
|
|
|
|
|
|
|
# SELECT c.id, (select concat(firstname,lastname) from users u where u.id=c.tea_id) as username,
|
|
|
|
|
# (select count(sfc.id) from students_for_courses sfc where c.id=sfc.course_id group by c.id) as student_count,
|
|
|
|
|