用户列表根据地区导出用户错误

dev_aliyun
daiao 5 years ago
parent 82ecf8ff5c
commit d4c8bec6f6

@ -3425,7 +3425,7 @@ end
users = users.where(schools: { province: params[:province] }) users = users.where(schools: { province: params[:province] })
end end
users = users.select('distinct users.*').order("last_login_on desc") users = users.select('distinct users.*')
@page = (params['page'] || 1).to_i @page = (params['page'] || 1).to_i
@users_count = users.count @users_count = users.count
@ -3433,16 +3433,19 @@ end
@is_remote = true @is_remote = true
@users_pages = Paginator.new @users_count, @limit, params['page'] || 1 @users_pages = Paginator.new @users_count, @limit, params['page'] || 1
@offset ||= @users_pages.offset @offset ||= @users_pages.offset
@users = paginateHelper users.preload(:real_name_authentication_apply, :professional_authentication_apply, @users = paginateHelper users.order("last_login_on desc").preload(:real_name_authentication_apply, :professional_authentication_apply,
user_extensions: [:department, :school]), @limit user_extensions: [:department, :school]), @limit
respond_to do |format| respond_to do |format|
format.js format.js
format.xls{ format.xls{
# @export_shixun_task = @export_shixun_task.all # @export_shixun_task = @export_shixun_task.all
@xls_users = users.reorder("created_on desc").limit(3000) #导出excel用户 @xls_users = users.limit(3000) #导出excel用户
@xls_users = @xls_users.includes(:real_name_authentication_apply, :professional_authentication_apply, @xls_users = @xls_users.includes(:real_name_authentication_apply, :professional_authentication_apply,
user_extensions: [:department, :school]) user_extensions: [:department, :school])
logger.info("##########xls_count#{@xls_users.count }")
logger.info("##########users#{users.count }")
filename = "用户列表.xls" filename = "用户列表.xls"
send_data(user_list_xls(@xls_users), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) send_data(user_list_xls(@xls_users), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
} }

@ -15,4 +15,7 @@ $("#user_export_list").attr("href", "<%= search_user_managements_path(:trial =>
:homepage_show => params[:homepage_show], :homepage_show => params[:homepage_show],
:te_technical_title => params[:te_technical_title], :te_technical_title => params[:te_technical_title],
:pro_technical_title => params[:pro_technical_title], :pro_technical_title => params[:pro_technical_title],
:province => params[:province],
:trial_whether => params[:trial_whether],
:realname => params[:realname],
:format => "xls") %>"); :format => "xls") %>");

Loading…
Cancel
Save