From e7b89d797ffcc2499097c83f41cc58629dd24bf5 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 5 Jun 2019 17:43:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E6=98=AF=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/discusses_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/discusses_service.rb b/app/services/discusses_service.rb index 29d3fcdc..a43ccfa8 100644 --- a/app/services/discusses_service.rb +++ b/app/services/discusses_service.rb @@ -56,7 +56,7 @@ class DiscussesService # 添加评论 def create params, current_user begin - hidden = current_user.admin? ? 0 : 1 + hidden = current_user.admin? ? false : true Discuss.create!(:dis_id => params[:shixun_id], :dis_type => "Shixun", :content => params[:content].gsub(" \;", "").strip, :user_id => current_user.id, :praise_count => 0, :position => params[:position], :challenge_id => params[:challenge_id], :hidden => hidden) # 发送手机通知 @@ -70,7 +70,7 @@ class DiscussesService def reply params, current_user begin base_dicuss params[:id] - hidden = current_user.admin? ? 0 : 1 + hidden = current_user.admin? ? false : true discuss = Discuss.create!(:content => params[:content].gsub(" \;", "").strip, :user_id => current_user.id, :parent_id => params[:id], :root_id => @discuss.root_id || params[:id], :praise_count => 0, :challenge_id => @discuss.challenge_id, :hidden => hidden, :dis_id => @discuss.dis_id, :dis_type => @discuss.dis_type, :position => @discuss.position)