add resume tariff column to user_card table

This commit is contained in:
iIronside 2022-11-17 12:40:22 +03:00
parent 0f8aa34b4f
commit 816b39fc74
6 changed files with 53 additions and 3 deletions

View File

@ -85,6 +85,7 @@ class UserCardSearch extends UserCard
'updated_at' => $this->updated_at, 'updated_at' => $this->updated_at,
'test_task_getting_date' => $this->test_task_getting_date, 'test_task_getting_date' => $this->test_task_getting_date,
'test_task_complete_date' => $this->test_task_complete_date, 'test_task_complete_date' => $this->test_task_complete_date,
'resume_tariff' => $this->resume_tariff,
]); ]);
$query->andFilterWhere(['like', 'fio', $this->fio]) $query->andFilterWhere(['like', 'fio', $this->fio])

View File

@ -120,6 +120,7 @@ use yii\widgets\ActiveForm;
<?php if (Yii::$app->user->can('confidential_information')): ?> <?php if (Yii::$app->user->can('confidential_information')): ?>
<div class="col-xs-6"> <div class="col-xs-6">
<?= $form->field($model, 'salary')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'salary')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'resume_tariff')->textInput(['maxlength' => true]) ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="col-xs-6"> <div class="col-xs-6">

View File

@ -80,6 +80,10 @@ $this->params['breadcrumbs'][] = $this->title;
'attribute' => 'salary', 'attribute' => 'salary',
'visible' => Yii::$app->user->can('confidential_information') 'visible' => Yii::$app->user->can('confidential_information')
], ],
[
'attribute' => 'resume_tariff',
'visible' => Yii::$app->user->can('confidential_information')
],
[ [
'attribute' => 'position_id', 'attribute' => 'position_id',
'value' => (isset($model->position->name)) ? $model->position->name : 'Без должности', 'value' => (isset($model->position->name)) ? $model->position->name : 'Без должности',

View File

@ -28,6 +28,7 @@ class ResumeTemplate extends \yii\db\ActiveRecord
'Пол' => '${gender}', 'Пол' => '${gender}',
'Резюме' => '${resume}', 'Резюме' => '${resume}',
'Зароботная плата' => '${salary}', 'Зароботная плата' => '${salary}',
'Ставка для резюме' => '${resume_tariff}',
'Позиция' => '${position_id}', 'Позиция' => '${position_id}',
'Город' => '${city}', 'Город' => '${city}',
'Ссылка ВК' => '${link_vk}', 'Ссылка ВК' => '${link_vk}',
@ -47,6 +48,7 @@ class ResumeTemplate extends \yii\db\ActiveRecord
'${gender}'=> 'gender', '${gender}'=> 'gender',
'${resume}'=> 'resume', '${resume}'=> 'resume',
'${salary}' => 'salary', '${salary}' => 'salary',
'${resume_tariff}' => 'resume_tariff',
'${position_id}'=> 'position_id', '${position_id}'=> 'position_id',
'${city}'=> 'city', '${city}'=> 'city',
'${link_vk}' => 'link_vk', '${link_vk}' => 'link_vk',
@ -104,7 +106,7 @@ class ResumeTemplate extends \yii\db\ActiveRecord
'created_at' => 'Created At', 'created_at' => 'Created At',
'updated_at' => 'Updated At', 'updated_at' => 'Updated At',
'status' => 'Статус', 'status' => 'Статус',
'template_body' => 'Template Body', 'template_body' => 'Тело шаблона',
'header_text' => 'Текст в верхнем контикуле', 'header_text' => 'Текст в верхнем контикуле',
'header_image' => 'Картинка в верхнем контикуле', 'header_image' => 'Картинка в верхнем контикуле',
]; ];

View File

@ -40,6 +40,7 @@ use yii\helpers\ArrayHelper;
* @property string $test_task_complete_date * @property string $test_task_complete_date
* @property string $resume_text * @property string $resume_text
* @property int $resume_template_id * @property int $resume_template_id
* @property int $resume_tariff
* *
* @property FieldsValue[] $fieldsValues * @property FieldsValue[] $fieldsValues
* @property ProjectUser[] $projectUsers * @property ProjectUser[] $projectUsers
@ -112,7 +113,7 @@ class UserCard extends \yii\db\ActiveRecord
{ {
return [ return [
[['fio', 'status', 'gender', 'email', 'level', 'position_id'], 'required'], [['fio', 'status', 'gender', 'email', 'level', 'position_id'], 'required'],
[['gender', 'status', 'position_id', 'id_user', 'level', 'years_of_exp'], 'integer'], [['gender', 'status', 'position_id', 'id_user', 'level', 'years_of_exp', 'resume_tariff'], 'integer'],
[['dob', 'created_at', 'updated_at', 'deleted_at', 'vc_text', 'vc_text_short', 'test_task_getting_date', 'test_task_complete_date'], 'safe'], [['dob', 'created_at', 'updated_at', 'deleted_at', 'vc_text', 'vc_text_short', 'test_task_getting_date', 'test_task_complete_date'], 'safe'],
['email', 'unique', 'message'=>'Почтовый адрес уже используется'], ['email', 'unique', 'message'=>'Почтовый адрес уже используется'],
[['fio', 'passport', 'photo', 'email', 'resume', 'city', 'link_vk', 'link_telegram', 'specification'], 'string', 'max' => 255], [['fio', 'passport', 'photo', 'email', 'resume', 'city', 'link_vk', 'link_telegram', 'specification'], 'string', 'max' => 255],
@ -158,7 +159,8 @@ class UserCard extends \yii\db\ActiveRecord
'test_task_getting_date' => 'Дата получения тестового', 'test_task_getting_date' => 'Дата получения тестового',
'test_task_complete_date' => 'Дата выполнения тестового', 'test_task_complete_date' => 'Дата выполнения тестового',
'resume_template_id' => 'Шаблон резюме', 'resume_template_id' => 'Шаблон резюме',
'resume_text' => 'Резюме сгенерированный текст' 'resume_text' => 'Резюме сгенерированный текст',
'resume_tariff' => 'Ставка для резюме'
]; ];
} }

View File

@ -0,0 +1,40 @@
<?php
use yii\db\Migration;
/**
* Class m221117_091058_add_resume_tariff_column_at_user_card_table
*/
class m221117_091058_add_resume_tariff_column_at_user_card_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('user_card', 'resume_tariff', $this->integer());
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropColumn('user_card', 'resume_tariff');
}
/*
// Use up()/down() to run migration code without a transaction.
public function up()
{
}
public function down()
{
echo "m221117_091058_add_resume_tariff_column_at_user_card_table cannot be reverted.\n";
return false;
}
*/
}