fix: 🐛 修复无法模糊匹配的问题

main
熊二 2 years ago
parent 583e1b72d0
commit 8151116592
  1. 2
      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
}

Loading…
Cancel
Save