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