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/helpers/managements_helper.rb b/app/helpers/managements_helper.rb index 0fb97d1e..18672057 100644 --- a/app/helpers/managements_helper.rb +++ b/app/helpers/managements_helper.rb @@ -4,7 +4,7 @@ module ManagementsHelper def user_phone_addr phone addr = "--" unless phone.nil? - result = nil # MobInfo.lookup(phone[0,7]) + result = MobInfo.lookup(phone[0,7]) if result.present? addr = "#{result[:province]}-#{result[:city]}" end @@ -15,7 +15,7 @@ module ManagementsHelper def user_ip_addr ip addr = "--" unless ip.nil? - result = nil # SM.find_by_ip(ip) + result = SM.find_by_ip(ip) if result.present? addr = "#{result[:province]}-#{result[:city]}" end diff --git a/app/views/managements/_reject_authorization_model.html.erb b/app/views/managements/_reject_authorization_model.html.erb index 3aaf2c6c..4d35359f 100644 --- a/app/views/managements/_reject_authorization_model.html.erb +++ b/app/views/managements/_reject_authorization_model.html.erb @@ -1,6 +1,6 @@