diff --git a/db/mysql/dao/tenants.go b/db/mysql/dao/tenants.go index 678087b1b..092c29613 100644 --- a/db/mysql/dao/tenants.go +++ b/db/mysql/dao/tenants.go @@ -91,7 +91,7 @@ func (t *TenantDaoImpl) GetTenantIDByName(name string) (*model.Tenants, error) { func (t *TenantDaoImpl) GetALLTenants(query string) ([]*model.Tenants, error) { var tenants []*model.Tenants if query != "" { - if err := t.DB.Where("name like '%?%'", query).Find(&tenants).Error; err != nil { + if err := t.DB.Where("name like ?", "%"+query+"%").Find(&tenants).Error; err != nil { return nil, err } } else {