diff --git a/repository/user.go b/repository/user.go index 8d49ce6..5293bf5 100644 --- a/repository/user.go +++ b/repository/user.go @@ -271,16 +271,16 @@ func (ur _UserRepository) FindUser(keyword *string, userType int16, state *bool, pattern := fmt.Sprintf("%%%s%%", *keyword) userQuery = userQuery.Where( goqu.Or( - goqu.Ex{"u.username": goqu.Op{"like": pattern}}, - goqu.Ex{"ud.name": goqu.Op{"like": pattern}}, - goqu.Ex{"ud.abbr": goqu.Op{"like": pattern}}, + goqu.I("u.username").ILike(pattern), + goqu.I("ud.name").ILike(pattern), + goqu.I("ud.abbr").ILike(pattern), ), ) countQuery = countQuery.Where( goqu.Or( - goqu.Ex{"u.username": goqu.Op{"like": pattern}}, - goqu.Ex{"ud.name": goqu.Op{"like": pattern}}, - goqu.Ex{"ud.abbr": goqu.Op{"like": pattern}}, + goqu.I("u.username").ILike(pattern), + goqu.I("ud.name").ILike(pattern), + goqu.I("ud.abbr").ILike(pattern), ), ) } @@ -428,9 +428,9 @@ func (ur _UserRepository) SearchUsersWithLimit(userType *int16, keyword *string, pattern := fmt.Sprintf("%%%s%%", *keyword) userQuery = userQuery.Where( goqu.Or( - goqu.Ex{"u.username": goqu.Op{"like": pattern}}, - goqu.Ex{"ud.name": goqu.Op{"like": pattern}}, - goqu.Ex{"ud.abbr": goqu.Op{"like": pattern}}, + goqu.I("u.username").ILike(pattern), + goqu.I("ud.name").ILike(pattern), + goqu.I("ud.abbr").ILike(pattern), ), ) }