Bugfix on member search page
This commit is contained in:
parent
36e48f6ce0
commit
def9f6ddcf
|
@ -66,8 +66,10 @@ func Forum() http.HandlerFunc {
|
|||
return
|
||||
}
|
||||
|
||||
// Inject pinned threads on top.
|
||||
threads = append(pinned, threads...)
|
||||
// Inject pinned threads on top of the first page.
|
||||
if pager.Page == 1 {
|
||||
threads = append(pinned, threads...)
|
||||
}
|
||||
|
||||
// Map the statistics (replies, views) of these threads.
|
||||
threadMap := models.MapThreadStatistics(threads)
|
||||
|
|
|
@ -343,13 +343,13 @@ func SearchUsers(user *User, search *UserSearch, pager *Pagination) ([]*User, er
|
|||
}
|
||||
|
||||
if len(blockedUserIDs) > 0 {
|
||||
wheres = append(wheres, "id NOT IN ?")
|
||||
wheres = append(wheres, "users.id NOT IN ?")
|
||||
placeholders = append(placeholders, blockedUserIDs)
|
||||
}
|
||||
|
||||
if search.Username != "" {
|
||||
ilike := "%" + strings.TrimSpace(strings.ToLower(search.Username)) + "%"
|
||||
wheres = append(wheres, "(username LIKE ? OR name ILIKE ?)")
|
||||
wheres = append(wheres, "(users.username LIKE ? OR users.name ILIKE ?)")
|
||||
placeholders = append(placeholders, ilike, ilike)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user