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

dev_jupyter
daiao 5 years ago
parent d8f3e65bfd
commit 375f724e57

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

Loading…
Cancel
Save