金科设置问题

dev_jupyter
daiao 5 years ago
parent dcf0cb5c6c
commit 84fcff9123

@ -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

@ -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

Loading…
Cancel
Save