Archived
1
0
Fork 0

app/models/Data/User.php: findFirstByUsernameOrEmail() should only fetch rows where status != deleted

This commit is contained in:
Henrik Hautakoski 2018-08-16 18:59:21 +02:00
parent 82fb869042
commit 1e46302267
No known key found for this signature in database
GPG key ID: 839F3A7EAFAEAFAA

View file

@ -359,8 +359,8 @@ class User extends Model
static public function findFirstByUsernameOrEmail($value) static public function findFirstByUsernameOrEmail($value)
{ {
return self::findFirst([ return self::findFirst([
"(email = :v: OR username = :v:) AND status = :s:", "(email = :v: OR username = :v:) AND status != :s:",
"bind" => [ 'v' => $value, 's' => self::STATUS_ACTIVE ] "bind" => [ 'v' => $value, 's' => self::STATUS_DELETED ]
]); ]);
} }