public function validatePhone($attribute, $params)
{
if (!$this->hasErrors()) {
$user = User::findOne(['phone' => $this->$attribute]);
if ($user ) {
$this->addError($attribute, 'Телефон занят');
}
}
['phone', 'validatePhone'],