课程搜索按时间倒序排序
This commit is contained in:
parent
05c74960a8
commit
45d5f9e58b
|
@ -40,9 +40,9 @@ class CoursesService
|
|||
end
|
||||
@courses = courses_all.visible(current_user)
|
||||
if params[:name].present?
|
||||
@courses_all = @courses.like(params[:name])
|
||||
@courses_all = @courses.like(params[:name]).order("created_at desc")
|
||||
else
|
||||
@courses_all = @courses;
|
||||
@courses_all = @courses.order("created_at desc");
|
||||
end
|
||||
@courses_all
|
||||
course_list = []
|
||||
|
|
Loading…
Reference in New Issue