dev_forum
SylorHuang 5 years ago
parent 3d6ab9da88
commit 8269367f47

@ -1029,20 +1029,19 @@ class PollsController < ApplicationController
end
#搜索
# 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}%")
# end
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}%")
end
logger.info("#######F_______@poll_users_list_last___@users_ids________________####{@poll_users_list.pluck(:id)}")
@poll_users_size = @poll_users_list.count
# 分页
@page = params[:page] || 1
@limit = params[:limit] || 20
@poll_users_list = @poll_users_list.page(@page).per(@limit)
page = params[:page] || 1
limit = params[:limit] || 20
@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
@poll_users_list = []
@poll_users_size = 0

Loading…
Cancel
Save