add employee module
This commit is contained in:
1 parent
f7c8ab4de6
commit
fc0b84f0f4
30 files changed
+4504
-27
No files matched your search
+15
-11
@@ -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']);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user