fixed 附件uuid查询精准匹配

This commit is contained in:
xxq250 2024-08-22 14:20:19 +08:00
parent cc5a671458
commit d69438454d
2 changed files with 3 additions and 3 deletions

View File

@ -89,8 +89,8 @@ class Journal < ApplicationRecord
when 'issue'
return "创建了<b>疑修</b>"
when 'attachment'
old_value = Attachment.where("id in (?) or uuid in (?)", detail.old_value.to_s.split(","), detail.old_value.to_s.split(",")).pluck(:filename).join("")
new_value = Attachment.where("id in (?) or uuid in (?)", detail.value.to_s.split(","), detail.value.to_s.split(",")).pluck(:filename).join("")
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("")
if old_value.nil? || old_value.blank?
content += "添加了<b>#{new_value}</b>附件"
else

View File

@ -9,7 +9,7 @@ module Api::V1::Issues::Concerns::Loadable
end
def load_attachments(attachment_ids)
@attachments = Attachment.where("id in (?) or uuid in (?)", attachment_ids, attachment_ids)
@attachments = Attachment.where("BINARY id in (?) or uuid in (?)", attachment_ids, attachment_ids)
end
def load_atme_receivers(receivers_login)