diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 8abb6c2b..5d245f6c 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -3476,7 +3476,7 @@ end type = params[:type] search = params[:search] if type == "0" - authentication_user = AuthenticationsUsers.where(:user_id => apply_action.user_id).first + authentication_user = AuthenticationsUsers.where(user_id => apply_action.user_id).first if authentication_user.blank? AuthenticationsUsers.create(:user_id => apply_action.user_id, :authentication_id => 1) end @@ -3507,7 +3507,8 @@ end Tiding.create(:user_id => apply_action.user_id, :trigger_user_id => 0, :container_id => apply_action.id, :container_type => 'ApplyAction', :parent_container_id => apply_action.container_id, :parent_container_type => apply_action.container_type, :belong_container_id => apply_action.container_id, :belong_container_type => "User", :tiding_type => "System", :status => type == "0" ? 1 : 2) - apply_action.update_attributes(:status => (params[:type] == "1" ? 2 : 1), :reason => params[:reject_reason], :dealer_id => User.current.id, :noticed => false) + reject_reason = Array(params[:reasons]).join(';') + 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}%'") diff --git a/app/helpers/managements_helper.rb b/app/helpers/managements_helper.rb index 18672057..0fb97d1e 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 = MobInfo.lookup(phone[0,7]) + result = nil # 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 = SM.find_by_ip(ip) + result = nil # SM.find_by_ip(ip) if result.present? addr = "#{result[:province]}-#{result[:city]}" end diff --git a/app/models/apply_action.rb b/app/models/apply_action.rb index f1cff688..ac6e306d 100644 --- a/app/models/apply_action.rb +++ b/app/models/apply_action.rb @@ -1,7 +1,7 @@ # status:0 审核中 1 同意 2 拒绝 3 撤销 class ApplyAction < ActiveRecord::Base default_scope :order => 'updated_at desc' - attr_accessible :container_id, :container_type, :dealer_id, :reason, :user_id, :status, :apply_reason, :noticed, :ip_addr + attr_accessible :container_id, :container_type, :dealer_id, :reason, :user_id, :status, :apply_reason, :noticed, :ip_addr, :reject_description belongs_to :user has_many :tidings, :as => :container, :dependent => :destroy after_create :send_tiding diff --git a/app/views/managements/_reject_authorization_model.html.erb b/app/views/managements/_reject_authorization_model.html.erb new file mode 100644 index 00000000..3aaf2c6c --- /dev/null +++ b/app/views/managements/_reject_authorization_model.html.erb @@ -0,0 +1,95 @@ +
+ diff --git a/app/views/managements/_trial_authorization_list.html.erb b/app/views/managements/_trial_authorization_list.html.erb index e3b6a57d..0e44ecfd 100644 --- a/app/views/managements/_trial_authorization_list.html.erb +++ b/app/views/managements/_trial_authorization_list.html.erb @@ -10,7 +10,7 @@