课程成员搜索忽略大小写

This commit is contained in:
sw 2015-04-14 15:16:58 +08:00
parent ead0ffb2f4
commit 1598bf6b4d
1 changed files with 3 additions and 3 deletions

View File

@ -233,10 +233,10 @@ module CoursesHelper
#searchPeopleByRoles(project, StudentRoles)
mems = []
if name != ""
name = name.to_s.downcase
members.each do |m|
username = m.user[:lastname].to_s + m.user[:firstname].to_s
if(m.user[:login].to_s.include?(name) || m.user.user_extensions[:student_id].to_s.include?(name) || username.include?(name))
username = m.user[:lastname].to_s.downcase + m.user[:firstname].to_s.downcase
if(m.user[:login].to_s.downcase.include?(name) || m.user.user_extensions[:student_id].to_s.downcase.include?(name) || username.include?(name))
mems << m
end
end