Changed LOWER(?) to ? COLLATE NOCASE
This commit is contained in:
parent
dd498cf18d
commit
705e3dfba1
3 changed files with 12 additions and 7 deletions
|
@ -41,9 +41,10 @@ class TagSearchService extends AbstractSearchService
|
|||
$token = '%' . $token;
|
||||
$token .= '%';
|
||||
$sqlQuery
|
||||
->and('LOWER(tag.name)')
|
||||
->like('LOWER(?)')
|
||||
->put($token);
|
||||
->and('tag.name')
|
||||
->like('?')
|
||||
->put($token)
|
||||
->collate()->nocase();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,7 +119,8 @@ class TagModel extends AbstractCrudModel
|
|||
$query = (new SqlQuery)
|
||||
->select('*')
|
||||
->from('tag')
|
||||
->where('LOWER(name) = LOWER(?)')->put($key);
|
||||
->where('name = ?')->put($key)
|
||||
->collate()->nocase();
|
||||
|
||||
$row = Database::fetchOne($query);
|
||||
if ($row)
|
||||
|
|
|
@ -89,7 +89,8 @@ class UserModel extends AbstractCrudModel
|
|||
$query = (new SqlQuery)
|
||||
->select('*')
|
||||
->from('user')
|
||||
->where('LOWER(name) = LOWER(?)')->put(trim($key));
|
||||
->where('name = ?')->put(trim($key))
|
||||
->collate()->nocase();
|
||||
|
||||
$row = Database::fetchOne($query);
|
||||
if ($row)
|
||||
|
@ -105,8 +106,10 @@ class UserModel extends AbstractCrudModel
|
|||
$query = new SqlQuery();
|
||||
$query->select('*')
|
||||
->from('user')
|
||||
->where('LOWER(name) = LOWER(?)')->put(trim($key))
|
||||
->or('LOWER(email_confirmed) = LOWER(?)')->put(trim($key));
|
||||
->where('name = ?')->put(trim($key))
|
||||
->collate()->nocase()
|
||||
->or('email_confirmed = ?')->put(trim($key))
|
||||
->collate()->nocase();
|
||||
|
||||
$row = Database::fetchOne($query);
|
||||
if ($row)
|
||||
|
|
Loading…
Reference in a new issue