summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index 01c7f50489..6a9828d573 100644
--- a/models/user.go
+++ b/models/user.go
@@ -1337,6 +1337,7 @@ func GetUser(user *User) (bool, error) {
type SearchUserOptions struct {
Keyword string
Type UserType
+ UID int64
OrderBy SearchOrderBy
Page int
PageSize int // Can be smaller than or equal to setting.UI.ExplorePagingNum
@@ -1355,9 +1356,14 @@ func (opts *SearchUserOptions) toConds() builder.Cond {
if opts.SearchByEmail {
keywordCond = keywordCond.Or(builder.Like{"LOWER(email)", lowerKeyword})
}
+
cond = cond.And(keywordCond)
}
+ if opts.UID > 0 {
+ cond = cond.And(builder.Eq{"id": opts.UID})
+ }
+
if !opts.IsActive.IsNone() {
cond = cond.And(builder.Eq{"is_active": opts.IsActive.IsTrue()})
}