From 375f724e5755bdb967c275ed5a4cfcaded58586a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 20 Feb 2020 18:17:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5=E5=AE=9E?= =?UTF-8?q?=E8=B7=B5=E8=AF=BE=E7=A8=8B=E5=85=AC=E5=BC=80=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/users/subject_service.rb | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/app/services/users/subject_service.rb b/app/services/users/subject_service.rb index 53ff3f4b9..d0b995c8e 100644 --- a/app/services/users/subject_service.rb +++ b/app/services/users/subject_service.rb @@ -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