diff --git a/app/decorators/tiding_decorator.rb b/app/decorators/tiding_decorator.rb index 30a325cd3..77bbcf9e3 100644 --- a/app/decorators/tiding_decorator.rb +++ b/app/decorators/tiding_decorator.rb @@ -97,7 +97,7 @@ module TidingDecorator elsif status == 2 I18n.t(locale_format(tiding_type, "#{status}_#{extra.nil?}"), reason: extra) % [name, second_name] else - I18n.t(locale_format(tiding_type, status)) % [name, second_name] + I18n.t(locale_format(tiding_type, status), reason: extra) % [name, second_name] end end @@ -106,9 +106,9 @@ module TidingDecorator if tiding_type == 'Apply' I18n.t(locale_format(tiding_type)) % name elsif status == 2 - I18n.t(locale_format(tiding_type, "#{status}_#{extra.nil?}"), reason: extra) % name + I18n.t(locale_format(tiding_type, "#{status}_#{extra.nil?}"), name: name, reason: extra) else - I18n.t(locale_format(tiding_type, status)) % name + I18n.t(locale_format(tiding_type, status), name: name, reason: extra) end end diff --git a/app/models/apply_user_authentication.rb b/app/models/apply_user_authentication.rb index c7fb5019e..d467eb850 100644 --- a/app/models/apply_user_authentication.rb +++ b/app/models/apply_user_authentication.rb @@ -3,8 +3,18 @@ class ApplyUserAuthentication < ApplicationRecord belongs_to :user + has_many :tidings, :as => :container, :dependent => :destroy + scope :real_name_auth, -> { where(auth_type: 1) } scope :professional_auth, -> { where(auth_type: 2) } scope :processing, -> { where(status: 0) } scope :passed, -> { where(status: 1) } + + after_create :send_tiding + + private + + def send_tiding + self.tidings << Tiding.new(:user_id => '1', :status=> 0, :trigger_user_id => user_id, :belong_container_id => 1, :belong_container_type =>'User', :tiding_type => "Apply") + end end diff --git a/config/locales/tidings/zh-CN.yml b/config/locales/tidings/zh-CN.yml index 456f15887..8d7d1950f 100644 --- a/config/locales/tidings/zh-CN.yml +++ b/config/locales/tidings/zh-CN.yml @@ -38,8 +38,8 @@ Apply_end: "申请添加单位:%s" System: "1_end": "你提交的添加单位申请:%{name},审核已通过" - "2_reason_end": "你提交的添加单位申请:%{name},审核未通过
原因:%{reason}" - "2_no_reason_end": "你提交的添加单位申请:%{name},审核未通过" + "2_false_end": "你提交的添加单位申请:%{name},审核未通过
原因:%{reason}" + "2_true_end": "你提交的添加单位申请:%{name},审核未通过" "3_end": "你提交的添加单位申请:%{name},已被更改为:%{reason}" ApplyAction: ApplyShixun: