add skill and position

This commit is contained in:
king199025
2018-10-12 14:52:08 +03:00
parent c9db4cd49b
commit 369cf94f23
52 changed files with 1129 additions and 62 deletions

View File

@ -21,10 +21,11 @@ use yii\db\Expression;
* @property string $updated_at
* @property string $resume
* @property string $salary
* @property int $position_id
*
* @property array $genders
* @property string $gendersText
*
* @property FieldsValue[] $fieldsValues
* @property ProjectUser[] $projectUsers
* @property Position $position
* @property Status $status0
*/
class UserCard extends \yii\db\ActiveRecord
@ -59,11 +60,11 @@ class UserCard extends \yii\db\ActiveRecord
{
return [
[['fio', 'status'], 'required'],
[['status'], 'integer'],
[['gender'], 'in', 'range' => array_keys($this->genders)],
[['gender', 'status', 'position_id'], 'integer'],
[['dob', 'created_at', 'updated_at'], 'safe'],
[['fio', 'passport', 'photo', 'email', 'resume'], 'string', 'max' => 255],
[['salary'], 'string', 'max' => 100],
[['position_id'], 'exist', 'skipOnError' => true, 'targetClass' => Position::class, 'targetAttribute' => ['position_id' => 'id']],
[['status'], 'exist', 'skipOnError' => true, 'targetClass' => Status::class, 'targetAttribute' => ['status' => 'id']],
];
}
@ -86,6 +87,7 @@ class UserCard extends \yii\db\ActiveRecord
'updated_at' => 'Дата редактирование',
'resume' => 'Резюме',
'salary' => 'Зарплата',
'position_id' => 'Должность',
];
}
@ -105,6 +107,14 @@ class UserCard extends \yii\db\ActiveRecord
return $this->hasMany(ProjectUser::class, ['card_id' => 'id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getPosition()
{
return $this->hasOne(Position::class, ['id' => 'position_id']);
}
/**
* @return \yii\db\ActiveQuery
*/