课程首页搜索优化

dev_course
daiao 6 years ago
parent 14dd69d1f1
commit 85df7ce8fc

@ -87,7 +87,7 @@ class CoursesController < ApplicationController
(course_members.role in (1,2,3) and CONCAT(users.lastname, users.firstname) like :keyword) or courses.name like :keyword
or schools.name like :keyword
}
@courses.includes(course_members: [user: [user_extension: :school]]).where(sql, keyword: "%#{params[:search]}%")
@courses = @courses.includes(course_members: [user: [user_extension: :school]]).where("#{sql}", keyword: "%#{params[:search]}%")
end
@courses_count = @courses.size

Loading…
Cancel
Save