diff --git a/app/controllers/admins/subjects_controller.rb b/app/controllers/admins/subjects_controller.rb index ed84fcb84..88f3ca527 100644 --- a/app/controllers/admins/subjects_controller.rb +++ b/app/controllers/admins/subjects_controller.rb @@ -49,7 +49,7 @@ class Admins::SubjectsController < Admins::BaseController # 设为金课 def excellent - current_subject.update!(excellent: true) + current_subject.update!(excellent: true, public: 2) render_ok end diff --git a/app/services/search_service.rb b/app/services/search_service.rb index 703f6dc1a..98501abdf 100644 --- a/app/services/search_service.rb +++ b/app/services/search_service.rb @@ -42,7 +42,7 @@ class SearchService < ApplicationService { where: { id: Laboratory.current.shixuns.where(public: 2, status: 2, fork_from: nil).or(Laboratory.current.shixuns.where(status: 2, id: User.current.shixuns)).pluck(:id) } } when 'subject' then { where: { id: Laboratory.current.subjects.where(public: 2, status: 2) - .or( Laboratory.current.subjects.where(status: 2, id: User.current.subjects).pluck(:id)) } } + .or( Laboratory.current.subjects.where(status: 2, id: User.current.subjects.pluck(:id))) } } when 'course' then { where: { id: Laboratory.current.all_courses.pluck(:id) } } else