add new fields

This commit is contained in:
king199025
2018-10-11 17:38:49 +03:00
parent 5e2bc02bb5
commit 43557838ac
5 changed files with 160 additions and 0 deletions

View File

@ -20,6 +20,7 @@ use yii\db\Expression;
* @property string $created_at
* @property string $updated_at
* @property string $resume
* @property string $salary
*
* @property array $genders
* @property string $gendersText
@ -62,6 +63,7 @@ class UserCard extends \yii\db\ActiveRecord
[['gender'], 'in', 'range' => array_keys($this->genders)],
[['dob', 'created_at', 'updated_at'], 'safe'],
[['fio', 'passport', 'photo', 'email', 'resume'], 'string', 'max' => 255],
[['salary'], 'string', 'max' => 100],
[['status'], 'exist', 'skipOnError' => true, 'targetClass' => Status::class, 'targetAttribute' => ['status' => 'id']],
];
}
@ -83,9 +85,26 @@ class UserCard extends \yii\db\ActiveRecord
'created_at' => 'Дата создания',
'updated_at' => 'Дата редактирование',
'resume' => 'Резюме',
'salary' => 'Зарплата',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getFieldsValues()
{
return $this->hasMany(FieldsValue::class, ['card_id' => 'id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getProjectUsers()
{
return $this->hasMany(ProjectUser::class, ['card_id' => 'id']);
}
/**
* @return \yii\db\ActiveQuery
*/