Друзья, подскажите, почему не работает код:
$user = User::findFirst(['email' => $email, 'active' => '1']);
При любом $email возвращается первая запись в таблице. Если же использовать данный код:
$user = User::findFirst([
'conditions' => 'email = :email: AND active="1"',
'bind' => [
'email' => $data['email'],
],
]);
все работает правильно. Что не так?
Guys, tell me, why this code is not working?
$user = User::FindFirst (['email' => $ email, 'activo' => '1']);
For any email it returns the first record of the table. If I use this code:
$user = User::findFirst([
'conditions' => 'email = :email: AND active="1"',
'bind' => [
'email' => $data['email'],
],
]);
Everything works properly. What is happening/what is wrong?