问卷的统计结果修改

dev_home
SylorHuang 5 years ago
parent 29c22fdf35
commit af89b0d051

@ -13,7 +13,7 @@ module PollsHelper
end end
def poll_votes_count(votes,user_ids) 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 end
#公用tab页的相关信息 #公用tab页的相关信息

@ -14,7 +14,7 @@ if @poll_questions_count > 0
json.array! @poll_questions do |question| json.array! @poll_questions do |question|
json.partial! "polls/commit_answers_result", question: question, json.partial! "polls/commit_answers_result", question: question,
answers:question.poll_answers, 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
end end
else else

Loading…
Cancel
Save