Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Предыдущая версия справа и слева Предыдущая версия
yii2:docs [2019/04/18 13:15] – [Validate (Rules)] mirocowyii2:docs [2019/04/18 13:17] (текущий) – [Active Record] mirocow
Строка 432: Строка 432:
 // the result as an array // the result as an array
 $posts = $query->asArray()->all(); $posts = $query->asArray()->all();
 +</code>
 +
 +<code php>
 +User::find()->where(['and', ['phone_number' => $phone], ['<>', 'id', $user->id] ])->exists();
 +User::find()->where(['or', ['phone_number' => $phone], ['=', 'id', $user->id] ])->exists();
 </code> </code>