From af89b0d051bfff4f6f80c66f058b3992922b7701 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Wed, 13 Nov 2019 16:52:14 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=9A=84=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/polls_helper.rb | 2 +- app/views/polls/commit_result.json.jbuilder | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/polls_helper.rb b/app/helpers/polls_helper.rb index 03210fccd..866d28254 100644 --- a/app/helpers/polls_helper.rb +++ b/app/helpers/polls_helper.rb @@ -13,7 +13,7 @@ module PollsHelper end def poll_votes_count(votes,user_ids) - votes.find_current_vote("user_id",user_ids.uniq).reject(&:blank?).size + votes.find_current_vote("user_id",user_ids.uniq).pluck(:user_id).uniq.reject(&:blank?).size end #公用tab页的相关信息 diff --git a/app/views/polls/commit_result.json.jbuilder b/app/views/polls/commit_result.json.jbuilder index 795d609a7..f5e983acf 100644 --- a/app/views/polls/commit_result.json.jbuilder +++ b/app/views/polls/commit_result.json.jbuilder @@ -14,7 +14,7 @@ if @poll_questions_count > 0 json.array! @poll_questions do |question| json.partial! "polls/commit_answers_result", question: question, answers:question.poll_answers, - question_votes:question.poll_votes.where(user_id:@poll_commit_ids) #问题的全部答案 + question_votes: question.poll_votes.where(user_id:@poll_commit_ids) #问题的全部答案 end end else