forked from Gitlink/forgeplus
fixed:操作日志为空的情况
This commit is contained in:
parent
01ef87f5a3
commit
b6de7fa96b
|
@ -532,10 +532,10 @@ class Journal < ApplicationRecord
|
|||
def operate_content
|
||||
content = "#{operate_by_content}"
|
||||
detail = self.journal_details.take
|
||||
content = ""
|
||||
case detail.property
|
||||
when 'issue'
|
||||
content += "创建了<b>疑修</b>"
|
||||
return content
|
||||
when 'attachment'
|
||||
old_value = Attachment.where("BINARY id in (?) or uuid in (?)", detail.old_value.to_s.split(","), detail.old_value.to_s.split(",")).pluck(:filename).join("、")
|
||||
new_value = Attachment.where("BINARY id in (?) or uuid in (?)", detail.value.to_s.split(","), detail.value.to_s.split(",")).pluck(:filename).join("、")
|
||||
|
@ -545,6 +545,7 @@ class Journal < ApplicationRecord
|
|||
new_value = "无" if new_value.blank?
|
||||
content += "将附件由<b>#{old_value}</b>更改为<b>#{new_value}</b>"
|
||||
end
|
||||
return content
|
||||
when 'issue_tag'
|
||||
old_value = IssueTag.where(id: detail.old_value.split(",")).pluck(:name).join("、")
|
||||
new_value = IssueTag.where(id: detail.value.split(",")).pluck(:name).join("、")
|
||||
|
@ -554,6 +555,7 @@ class Journal < ApplicationRecord
|
|||
new_value = "无" if new_value.blank?
|
||||
content += "将标记由<b>#{old_value}</b>更改为<b>#{new_value}</b>"
|
||||
end
|
||||
return content
|
||||
when 'assigner'
|
||||
old_value = User.where(id: detail.old_value.split(",")).map{|u| u.real_name}.join("、")
|
||||
new_value = User.where(id: detail.value.split(",")).map{|u| u.real_name}.join("、")
|
||||
|
@ -563,6 +565,7 @@ class Journal < ApplicationRecord
|
|||
new_value = "无" if new_value.blank?
|
||||
content += "将负责人由<b>#{old_value}</b>更改为<b>#{new_value}</b>"
|
||||
end
|
||||
return content
|
||||
when 'attr'
|
||||
content += "将"
|
||||
case detail.prop_key
|
||||
|
@ -605,6 +608,7 @@ class Journal < ApplicationRecord
|
|||
new_value = "无" if new_value.blank?
|
||||
content += "由<b>#{old_value}</b>更改为<b>#{new_value}</b>"
|
||||
end
|
||||
return content
|
||||
end
|
||||
content = self.pm_operate_content if content == ""
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue