搜索用户修改为按昵称搜索

This commit is contained in:
z9hang 2014-07-01 16:31:40 +08:00
parent a7fa444f9e
commit 2e38f66899
1 changed files with 2 additions and 1 deletions

View File

@ -202,7 +202,8 @@ class User < Principal
where(nil) where(nil)
else else
pattern = "%#{arg.to_s.strip.downcase}%" pattern = "%#{arg.to_s.strip.downcase}%"
where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern) #where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern)
where(" LOWER(login) LIKE :p ", :p => pattern)
end end
} }