add employee module

This commit is contained in:
iIronside
2021-11-16 13:14:28 +03:00
parent f7c8ab4de6
commit e561687b09
30 changed files with 4503 additions and 26 deletions

View File

@ -57,6 +57,17 @@ class User extends ActiveRecord implements IdentityInterface
];
}
public function beforeSave($insert)
{
if (parent::beforeSave($insert)) {
if ($this->isNewRecord) {
$this->auth_key = Yii::$app->security->generateRandomString();
}
return true;
}
return false;
}
/**
* {@inheritdoc}
*/
@ -205,20 +216,13 @@ class User extends ActiveRecord implements IdentityInterface
$this->password_reset_token = null;
}
public function beforeSave($insert)
{
if (parent::beforeSave($insert)) {
if ($this->isNewRecord) {
$this->auth_key = Yii::$app->security->generateRandomString();
}
return true;
}
return false;
}
public function getUserCard()
{
return $this->hasOne(UserCard::class, ['id_user' => 'id']);
}
public function getManager()
{
return $this->hasOne(Manager::class, ['user_id' => 'id']);
}
}