dev_forum
SylorHuang 6 years ago
parent 6ffa26bc3a
commit f2acf4b2c7

@ -899,7 +899,7 @@ class PollsController < ApplicationController
@poll_multi_questions = @poll.poll_questions.where(question_type:2).select(:id,:max_choices,:min_choices,:question_number)
error_question = []
@poll_multi_questions.each do |q|
poll_user_votes = current_user.poll_votes.where(question_id:q.id)&.size
poll_user_votes = current_user.poll_votes.where(poll_question_id:q.id)&.size
if q.max_choices.present? && (poll_user_votes > q.max_choices)
error_messages = "#{q.question_number}题:超过最大选项限制"
elsif q.min_choices.present? && (poll_user_votes < q.min_choices)

Loading…
Cancel
Save