This commit is contained in:
huang 2016-03-25 17:06:59 +08:00
parent 09fc2589a9
commit 8f0038c3ff
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ module CoursesHelper
def find_excelletn_course keywords, current_course def find_excelletn_course keywords, current_course
# 获取tag匹配结果ID # 获取tag匹配结果ID
a_tags = [] a_tags = []
Course.where("is_excellent =? and is_public =?", 1, 1).includes(:tags).each do |ec| Course.where("is_excellent =? and is_public =?", 1, 1).each do |ec|
if ec.tags.any?{|value| current_course.name.include?(value.to_s)} if ec.tags.any?{|value| current_course.name.include?(value.to_s)}
a_tags << ec.id a_tags << ec.id
end end