From 0d76e11680881a2cde60872d9fddea5506d0c03a Mon Sep 17 00:00:00 2001 From: glyasai Date: Mon, 4 Nov 2019 14:08:01 +0800 Subject: [PATCH] expected 0 arguments, got 1 --- db/mysql/dao/tenants.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 {