修改课程列表显示不对的BUG

This commit is contained in:
yuanke 2016-07-08 18:52:21 +08:00
parent 189e641d23
commit 5ccde8e433
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ class SyllabusesService
syllabuses = Syllabus.where("id in #{syllabus_ids} or user_id = #{user.id}").order("updated_at desc")
syllabuses.each do |syllabus|
syllabus.courses = syllabus.courses.not_deleted
syllabus.courses = courses.where("syllabus_id = #{syllabus.id}").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("time desc")
end
syllabuses.to_a << other