Compare commits

...

2 Commits

1 changed files with 12 additions and 0 deletions

View File

@ -54,6 +54,7 @@ class UserAction < ApplicationRecord
case action_type
when "DestroyUser" then "账号:#{user&.login}<br/>邮箱:#{user&.mail}<br/>手机号:#{user&.phone}<br/>昵称:#{user&.nickname}<br/>"
when "DestroyProject" then "项目名称:#{project&.name}<br/>项目标识:#{project&.identifier}<br/>"
when "DestroyOrganization" then "组织名称:#{organization&.name}<br/>组织标识:#{organization&.login}<br/>"
else "--"
end
end
@ -75,6 +76,17 @@ class UserAction < ApplicationRecord
end
action_project
end
def organization
action_organization = if action_type == "DestroyOrganization" && data_bank.present?
build_mode("Organization")
else
Organization.find_by(id: self.action_id)
end
action_organization
end
def build_mode(model_name)
model = model_name.constantize.new
model_name.constantize.column_names.each do |col|