|
|
|
@ -34,7 +34,8 @@ class UserForm extends Model
|
|
|
|
|
[['username', 'email', 'role'], 'required'], |
|
|
|
|
['email', 'email'], |
|
|
|
|
['email', 'string', 'max' => 255], |
|
|
|
|
[['username', 'email'], 'unique', 'targetClass' => User::class, 'filter' => ['<>', 'id', $this->_user->id]], |
|
|
|
|
//[['username', 'email'], 'unique', 'targetClass' => User::class, 'filter' => ['<>', 'id', $this->_user->id]], |
|
|
|
|
[['username', 'email'], 'unique', 'targetClass' => User::class, 'filter' => isset($this->_user->id) ? ['<>', 'id', $this->_user->id] : null ], |
|
|
|
|
['password', 'string', 'min' => 6], |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|