操作记录记录显示调整,不存在用户仅显示id

This commit is contained in:
2024-09-27 11:28:59 +08:00
parent 6574aff205
commit 6924366e02
2 changed files with 5 additions and 4 deletions

View File

@@ -40,10 +40,11 @@ class UserAction < ApplicationRecord
end
def opt_user_name
if user&.id == user_id
"--"
user = User.find_by(id: self.user_id)
if user.present?
user&.login
else
User.find_by(id: self.user_id)&.login
"不存用户:#{action_id}"
end
end