|
|
|
@ -39,7 +39,15 @@ type SearchUserOptions struct {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (opts *SearchUserOptions) toSearchQueryBase() *xorm.Session { |
|
|
|
|
var cond builder.Cond = builder.Eq{"type": opts.Type} |
|
|
|
|
var cond builder.Cond |
|
|
|
|
if opts.Type == UserTypeIdentity { |
|
|
|
|
cond = builder.Or( |
|
|
|
|
builder.Eq{"type": UserTypeIndividual}, |
|
|
|
|
builder.Eq{"type": UserTypeOrganization}, |
|
|
|
|
) |
|
|
|
|
} else { |
|
|
|
|
cond = builder.Eq{"type": opts.Type} |
|
|
|
|
} |
|
|
|
|
if len(opts.Keyword) > 0 { |
|
|
|
|
lowerKeyword := strings.ToLower(opts.Keyword) |
|
|
|
|
keywordCond := builder.Or( |
|
|
|
|