新建作业选择课程下拉框按时间倒排

This commit is contained in:
sw 2015-09-25 15:01:24 +08:00
parent 29fd5b41e2
commit 4a838611fd
1 changed files with 1 additions and 1 deletions

View File

@ -582,7 +582,7 @@ module UsersHelper
option << "请选择发布作业的课程"
option << -1
type << option
user.courses.select{|c| user.allowed_to?(:as_teacher,c)}.each do |course|
user.courses.visible.select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").select{|c| user.allowed_to?(:as_teacher,c)}.each do |course|
option = []
option << course.name+""+course.time.to_s+course.term+""
option << course.id