This commit is contained in:
glambertessa 2020-09-09 15:01:10 +03:00
commit fefe0ef553
4 changed files with 40 additions and 1 deletions

View File

@ -70,6 +70,12 @@ use yii\widgets\ActiveForm;
<div class="col-xs-6"> <div class="col-xs-6">
<?= $form->field($model, 'city')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'city')->textInput(['maxlength' => true]) ?>
</div> </div>
<div class="col-xs-3">
<?= $form->field($model, 'link_vk')->textInput(['maxlength' => true]) ?>
</div>
<div class="col-xs-3">
<?= $form->field($model, 'link_telegram')->textInput(['maxlength' => true]) ?>
</div>
</div> </div>
<div class="row"> <div class="row">

View File

@ -53,6 +53,10 @@ $this->params['breadcrumbs'][] = $this->title;
'email:email', 'email:email',
'link_vk:url',
'link_telegram:url',
'dob', 'dob',
[ [
'attribute' => 'status', 'attribute' => 'status',

View File

@ -68,7 +68,7 @@ class UserCard extends \yii\db\ActiveRecord
[['fio', 'status', 'gender', 'email'], 'required'], [['fio', 'status', 'gender', 'email'], 'required'],
[['gender', 'status', 'position_id', 'id_user'], 'integer'], [['gender', 'status', 'position_id', 'id_user'], 'integer'],
[['dob', 'created_at', 'updated_at', 'deleted_at'], 'safe'], [['dob', 'created_at', 'updated_at', 'deleted_at'], 'safe'],
[['fio', 'passport', 'photo', 'email', 'resume', 'city'], 'string', 'max' => 255], [['fio', 'passport', 'photo', 'email', 'resume', 'city', 'link_vk', 'link_telegram'], 'string', 'max' => 255],
[['salary'], 'string', 'max' => 100], [['salary'], 'string', 'max' => 100],
[['position_id'], 'exist', 'skipOnError' => true, 'targetClass' => Position::class, 'targetAttribute' => ['position_id' => 'id']], [['position_id'], 'exist', 'skipOnError' => true, 'targetClass' => Position::class, 'targetAttribute' => ['position_id' => 'id']],
[['status'], 'exist', 'skipOnError' => true, 'targetClass' => Status::class, 'targetAttribute' => ['status' => 'id']], [['status'], 'exist', 'skipOnError' => true, 'targetClass' => Status::class, 'targetAttribute' => ['status' => 'id']],
@ -97,6 +97,8 @@ class UserCard extends \yii\db\ActiveRecord
'salary' => 'Зарплата', 'salary' => 'Зарплата',
'position_id' => 'Должность', 'position_id' => 'Должность',
'city' => 'Город', 'city' => 'Город',
'link_vk' => 'VK',
'link_telegram' => 'Telegram',
]; ];
} }

View File

@ -0,0 +1,27 @@
<?php
use yii\db\Migration;
/**
* Class m200805_113316_add_columns_links_to_user_card_table
*/
class m200805_113316_add_columns_links_to_user_card_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('user_card', 'link_vk', $this->string(255));
$this->addColumn('user_card', 'link_telegram', $this->string(255));
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropColumn('user_card', 'link_vk');
$this->dropColumn('user_card', 'link_telegram');
}
}