From 1fa27ae9d3cb77d8ff93c6c9cb1e047bef698d33 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Wed, 8 May 2019 15:42:14 +0800 Subject: [PATCH] fix reject trial auth feature issue --- app/controllers/managements_controller.rb | 19 +++++++++++-------- .../_reject_authorization_model.html.erb | 17 ++++++++++++++++- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 679f2e11..a1bc853b 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -3511,14 +3511,17 @@ end apply_action.update_attributes(status: (params[:type] == "1" ? 2 : 1), reason: reject_reason, reject_description: params[:reject_description], dealer_id: User.current.id, noticed: false) User.where(:id => apply_action.user_id).first.update_attributes(:certification => (params[:type] == "1" ? 2 : 1)) - user_id = User.find_by_sql("select id from users where concat(lastname,firstname) like '%#{search}%'") - @authorizations = ApplyAction.where(:container_type => "TrialAuthorization", :status => 0, :user_id => user_id).includes(:user) - @autu_count = @authorizations.count - @limit = 15 - @is_remote = true - @autu_pages = Paginator.new @autu_count, @limit, params['page'] || 1 - @offset ||= @autu_pages.offset - @authorizations = paginateHelper @authorizations, @limit + + if params[:reject_type] != "revocation" + user_id = User.find_by_sql("select id from users where concat(lastname,firstname) like '%#{search}%'") + @authorizations = ApplyAction.where(:container_type => "TrialAuthorization", :status => 0, :user_id => user_id).includes(:user) + @autu_count = @authorizations.count + @limit = 15 + @is_remote = true + @autu_pages = Paginator.new @autu_count, @limit, params['page'] || 1 + @offset ||= @autu_pages.offset + @authorizations = paginateHelper @authorizations, @limit + end respond_to do |format| format.js end diff --git a/app/views/managements/_reject_authorization_model.html.erb b/app/views/managements/_reject_authorization_model.html.erb index 3aaf2c6c..f8cd2c02 100644 --- a/app/views/managements/_reject_authorization_model.html.erb +++ b/app/views/managements/_reject_authorization_model.html.erb @@ -1,6 +1,6 @@