🐛 Fix search account query

This commit is contained in:
LittleSheep 2024-07-30 19:39:53 +08:00
parent 57b4b314fe
commit e97f3b6047

View File

@ -69,7 +69,7 @@ func LookupAccount(probe string) (models.Account, error) {
func SearchAccount(probe string) ([]models.Account, error) {
probe = "%" + probe + "%"
var accounts []models.Account
if err := database.C.Where("name LIKE ? OR nick LIKE ?", probe).Find(&accounts).Error; err != nil {
if err := database.C.Where("name LIKE ? OR nick LIKE ?", probe, probe).Find(&accounts).Error; err != nil {
return accounts, err
}
return accounts, nil