课程列表改下

This commit is contained in:
yuanke 2016-07-08 18:32:30 +08:00
parent 1df1368214
commit 189e641d23
1 changed files with 1 additions and 2 deletions

View File

@ -47,8 +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|
syllabuses.each do |syllabus|
syllabus.courses = syllabus.courses.not_deleted
end