From ce772f7c89bb493cc6400567dc96d3108a71618f Mon Sep 17 00:00:00 2001 From: liuzx Date: Thu, 24 Mar 2022 10:32:40 +0800 Subject: [PATCH] fix-bug --- models/attachment.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/attachment.go b/models/attachment.go index dc2763ba6..c7d058651 100755 --- a/models/attachment.go +++ b/models/attachment.go @@ -585,7 +585,7 @@ func Attachments(opts *AttachmentsOptions) ([]*AttachmentInfo, int64, error) { } else { lowerKeyWord := strings.ToLower(opts.Keyword) - cond = cond.And(builder.Or(builder.Like{"LOWER(attachment.name)", lowerKeyWord})) + cond = cond.And(builder.Or(builder.Like{"LOWER(attachment.name)", lowerKeyWord}, builder.Like{"LOWER(attachment.description)", lowerKeyWord})) count, err = sess.Table(&Attachment{}).Where(cond).Count(new(AttachmentInfo)) }