diff --git a/common/dao/corp.go b/common/dao/corp.go index f50608f..704bd0a 100644 --- a/common/dao/corp.go +++ b/common/dao/corp.go @@ -2,6 +2,7 @@ package dao import ( "enterprise/common/model" + "fmt" "gorm.io/gorm" "time" ) @@ -53,7 +54,7 @@ func (d *CorpDao) Get(id int64) (*model.Corp, error) { func (d *CorpDao) GetByHost(host string) (*model.Corp, error) { var u model.Corp tx := GetDB().Table(d.TableName()) - tx = tx.Where("host = ?", host) + tx = tx.Where("host LIKE ?", fmt.Sprintf("%%%s%%", host)) res := tx.First(&u) if res.Error == gorm.ErrRecordNotFound { return nil, nil