搜索课程,使结果按照开课时间、创建时间倒排
This commit is contained in:
parent
6c7a4d139d
commit
7980d92ff7
|
@ -107,7 +107,7 @@ class CoursesController < ApplicationController
|
||||||
courses = Course.visible
|
courses = Course.visible
|
||||||
@courses = paginateHelper courses,10
|
@courses = paginateHelper courses,10
|
||||||
else
|
else
|
||||||
courses = Course.visible.where("LOWER(name) like '%#{params[:name].to_s.downcase}%'")
|
courses = Course.visible.where("LOWER(name) like '%#{params[:name].to_s.downcase}%'").order("time desc, created_at desc")
|
||||||
@courses = paginateHelper courses,10
|
@courses = paginateHelper courses,10
|
||||||
end
|
end
|
||||||
@name = params[:name]
|
@name = params[:name]
|
||||||
|
|
Loading…
Reference in New Issue