corp host
This commit is contained in:
parent
9a84b0172f
commit
111b3b0a5a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue