新建班级时的课程下拉列表应包含所在课程教师团队的课程

This commit is contained in:
cxt 2016-10-08 14:03:37 +08:00
parent 7f3bb0be63
commit 1fa07b97e3
1 changed files with 3 additions and 1 deletions

View File

@ -3578,7 +3578,9 @@ def get_group_member_names work
end
def course_syllabus_option user = User.current
syllabuses = user.syllabuses
syllabus_members = SyllabusMember.where("user_id = #{user.id}")
syllabus_ids = syllabus_members.empty? ? "(-1)" : "(" + syllabus_members.map{|mem| mem.syllabus_id}.join(',') + ")"
syllabuses = Syllabus.where("id in #{syllabus_ids}")
type = []
option1 = []
option1 << "请选择课程"