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 1/2] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=9C=B0=E5=8C=BA=E5=AF=BC=E5=87=BA=E7=94=A8?= =?UTF-8?q?=E6=88=B7=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") %>"); From 7a24266bb2120f97a212044a3edf09d70853b594 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 30 Jul 2019 15:31:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index fb160916..414b344e 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -3444,8 +3444,6 @@ end @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)) }