corp host

This commit is contained in:
jiangyong27 2025-03-11 17:11:35 +08:00
parent 9a84b0172f
commit 111b3b0a5a
1 changed files with 2 additions and 1 deletions

View File

@ -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