From 81511165926fbf12cf25d27bdc6b4ca988a309bf Mon Sep 17 00:00:00 2001 From: hupeh Date: Mon, 2 Jan 2023 12:16:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20:bug:=20=E4=BF=AE=E5=A4=8D=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=A8=A1=E7=B3=8A=E5=8C=B9=E9=85=8D=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/db.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/db.go b/app/db.go index e23f2e1..0d1742a 100644 --- a/app/db.go +++ b/app/db.go @@ -62,7 +62,7 @@ func Paginate(r *Request) func(db *gorm.DB) *gorm.DB { func Search(r *Request, key, query string) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { if keyword, ok := r.Get(key); ok { - return db.Where(query, keyword) + return db.Where(query, "%"+keyword+"%") } else { return db }