From 93ea9a2ad8705381112322032e4d696045f04155 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 2 Aug 2019 20:38:38 +0800 Subject: [PATCH 1/3] fix tiding --- app/decorators/tiding_decorator.rb | 4 ++-- config/locales/tidings/zh-CN.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/decorators/tiding_decorator.rb b/app/decorators/tiding_decorator.rb index 30a325cd3..2e800c4b4 100644 --- a/app/decorators/tiding_decorator.rb +++ b/app/decorators/tiding_decorator.rb @@ -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/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: From 6b02e495a8ce15c44905858b9b5b01b5c8319ba3 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 2 Aug 2019 20:41:16 +0800 Subject: [PATCH 2/3] fix --- app/decorators/tiding_decorator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/decorators/tiding_decorator.rb b/app/decorators/tiding_decorator.rb index 2e800c4b4..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 From e459f48ac9802af92795beba934f2b03aa2703c6 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 2 Aug 2019 20:45:01 +0800 Subject: [PATCH 3/3] fix --- app/models/apply_user_authentication.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) 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