diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 1004a49a..4ff5a48e 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -141,27 +141,26 @@ module WelcomeHelper Course.active.visible. joins(:memberships). group('members.course_id'). - reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum - + reorder("courses.created_at DESC, COUNT(members.course_id) DESC").take sum else if school_id.nil? Course.active.visible. joins(:memberships). where("#{Course.table_name}.school_id = ?", User.current.user_extensions.school.id). group('members.course_id'). - reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum + reorder("courses.created_at DESC, COUNT(members.course_id) DESC").take sum else if school_id == "0" Course.active.visible. joins(:memberships). group('members.course_id'). - reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum + reorder("courses.created_at DESC, COUNT(members.course_id) DESC").take sum else Course.active.visible. joins(:memberships). where("#{Course.table_name}.school_id = ?", school_id). group('members.course_id'). - reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum + reorder("courses.created_at DESC, COUNT(members.course_id) DESC").take sum end end end diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index e79cc12c..624bd01d 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -73,7 +73,7 @@

新开课程

<% if @school_id %> - <% school_course = find_miracle_course(10, 7, @school_id) %> + <% school_course = find_miracle_course(10,7, @school_id) %> <% else %> <%school_course=[]%> <% end %> @@ -138,6 +138,7 @@