Browse Source

Loading users by name, not case sensitive

Visman 5 years ago
parent
commit
837750c86a
1 changed files with 5 additions and 1 deletions
  1. 5 1
      app/Models/User/Load.php

+ 5 - 1
app/Models/User/Load.php

@@ -23,7 +23,11 @@ class Load extends Action
             $where = 'u.id IN (?ai:field)';
         } elseif ($value instanceof User) {
             if ('' != $value->username) {
-                $where = 'u.username=?s:field';
+                if (true === $value->ciNameSearch) {
+                    $where = 'LOWER(u.username)=LOWER(?s:field)';
+                } else {
+                    $where = 'u.username=?s:field';
+                }
                 $value = $value->username;
             } elseif ('' != $value->email && '' != $value->email_normal) {
                 $where = 'u.email_normal=?s:field';