fix: nickname search alone

This commit is contained in:
2021-06-15 16:14:15 +08:00
parent 818317c292
commit 7fccd2aed2
21 changed files with 67 additions and 68 deletions

View File

@@ -10,7 +10,7 @@ class UserQuery < ApplicationQuery
# 真实姓名
if name = strip_param(:name)
users = users.where('LOWER(CONCAT_WS(users.lastname, users.firstname, users.nickname)) LIKE ?', "%#{name.downcase}%")
users = users.where('LOWER(CONCAT(users.lastname, users.firstname)) LIKE ? OR users.nickname LIKE ?', "%#{name.downcase}%", "%#{name.downcase}%")
end
# 单位名称