From d4c8bec6f6e0ab0c00b0c3f3b84ec6a8113df7f2 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 30 Jul 2019 15:24:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E5=9C=B0=E5=8C=BA=E5=AF=BC=E5=87=BA=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 9 ++++++--- app/views/managements/search_user.js.erb | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 7e3b3eb0..fb160916 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -3425,7 +3425,7 @@ end users = users.where(schools: { province: params[:province] }) end - users = users.select('distinct users.*').order("last_login_on desc") + users = users.select('distinct users.*') @page = (params['page'] || 1).to_i @users_count = users.count @@ -3433,16 +3433,19 @@ end @is_remote = true @users_pages = Paginator.new @users_count, @limit, params['page'] || 1 @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 respond_to do |format| format.js format.xls{ # @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, user_extensions: [:department, :school]) + + logger.info("##########xls_count#{@xls_users.count }") + logger.info("##########users#{users.count }") filename = "用户列表.xls" send_data(user_list_xls(@xls_users), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) } diff --git a/app/views/managements/search_user.js.erb b/app/views/managements/search_user.js.erb index 6db08224..27f379fd 100644 --- a/app/views/managements/search_user.js.erb +++ b/app/views/managements/search_user.js.erb @@ -15,4 +15,7 @@ $("#user_export_list").attr("href", "<%= search_user_managements_path(:trial => :homepage_show => params[:homepage_show], :te_technical_title => params[:te_technical_title], :pro_technical_title => params[:pro_technical_title], + :province => params[:province], + :trial_whether => params[:trial_whether], + :realname => params[:realname], :format => "xls") %>");