修改课程列表显示有误的问题

This commit is contained in:
yuanke 2016-07-08 18:08:31 +08:00
parent c2166811eb
commit f1f61c304a
1 changed files with 1 additions and 0 deletions

View File

@ -47,6 +47,7 @@ class SyllabusesService
syllabus_ids = courses.empty? ? '(-1)' : "(" + courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")"
syllabuses = Syllabus.where("id in #{syllabus_ids} or user_id = #{user.id}").order("updated_at desc")
user.syllabuses = syllabuses
user.syllabuses.each do |syllabus|
syllabus.courses = syllabus.courses.not_deleted
end