课程列表改下
This commit is contained in:
parent
1df1368214
commit
189e641d23
|
@ -47,8 +47,7 @@ class SyllabusesService
|
||||||
syllabus_ids = courses.empty? ? '(-1)' : "(" + courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")"
|
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")
|
syllabuses = Syllabus.where("id in #{syllabus_ids} or user_id = #{user.id}").order("updated_at desc")
|
||||||
|
|
||||||
user.syllabuses = syllabuses
|
syllabuses.each do |syllabus|
|
||||||
user.syllabuses.each do |syllabus|
|
|
||||||
syllabus.courses = syllabus.courses.not_deleted
|
syllabus.courses = syllabus.courses.not_deleted
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue