diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 36eebe4f2..64531a6f4 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -24,7 +24,7 @@ module CoursesHelper def find_excelletn_course keywords, current_course # 获取tag匹配结果ID 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)} a_tags << ec.id end