dev_forum
SylorHuang 5 years ago
parent 1cbd20b57a
commit 3d6ab9da88

@ -1029,15 +1029,20 @@ class PollsController < ApplicationController
end end
#搜索 #搜索
if search_content.present? # if search_content.present?
@poll_users_list = @poll_users_list.joins(user: :user_extension).where("CONCAT(lastname, firstname) like ? OR student_id like ?", "%#{search_content}%", "%#{search_content}%") # @poll_users_list = @poll_users_list.joins(user: :user_extension).where("CONCAT(lastname, firstname) like ? OR student_id like ?", "%#{search_content}%", "%#{search_content}%")
end # end
logger.info("#######F_______@poll_users_list_last___@users_ids________________####{@poll_users_list.pluck(:id)}")
@poll_users_size = @poll_users_list.count @poll_users_size = @poll_users_list.count
# 分页 # 分页
@page = params[:page] || 1 @page = params[:page] || 1
@limit = params[:limit] || 20 @limit = params[:limit] || 20
@poll_users_list = @poll_users_list.page(@page).per(@limit) @poll_users_list = @poll_users_list.page(@page).per(@limit)
logger.info("#######F_______@poll_users_list_after_page___@users_ids________________####{@poll_users_list.pluck(:id)}")
else else
@poll_users_list = [] @poll_users_list = []
@poll_users_size = 0 @poll_users_size = 0

Loading…
Cancel
Save