个人主页实践课程公开状态问题

dev_jupyter
daiao 5 years ago
parent d8f3e65bfd
commit 375f724e57

@ -70,12 +70,21 @@ class Users::SubjectService
end end
def manage_subject_status_filter(relations) def manage_subject_status_filter(relations)
if params[:status] == "publiced"
relations = relations.where(public: 2)
elsif params[:status] == "applying"
relations = relations.where(public: 1)
else
status = case params[:status] status = case params[:status]
when 'editing' then 0 when 'editing' then
when 'applying' then 1 0
when 'published' then 2 when 'applying' then
1
when 'published' then
2
end end
relations = relations.where(status: status) if status relations = relations.where(status: status) if status
end
relations relations
end end

Loading…
Cancel
Save