add at_project field to user_card

This commit is contained in:
iIronside
2022-12-19 16:21:19 +03:00
parent b6d958bdc0
commit 3c922a6627
7 changed files with 74 additions and 3 deletions

View File

@ -20,7 +20,7 @@ class UserCardSearch extends UserCard
public function rules()
{
return [
[['id', 'gender', 'status'], 'integer'],
[['id', 'gender', 'status', 'at_project'], 'integer'],
[['fio', 'passport', 'photo', 'email', 'dob', 'created_at', 'updated_at', 'city', 'test_task_getting_date', 'test_task_complete_date'], 'safe'],
['skills', 'each', 'rule' => ['integer']],
];
@ -86,6 +86,7 @@ class UserCardSearch extends UserCard
'test_task_getting_date' => $this->test_task_getting_date,
'test_task_complete_date' => $this->test_task_complete_date,
'resume_tariff' => $this->resume_tariff,
'at_project' => $this->at_project,
]);
$query->andFilterWhere(['like', 'fio', $this->fio])

View File

@ -149,6 +149,17 @@ use yii\widgets\ActiveForm;
</div>
</div>
<div class="row">
<div class="col-xs-6">
<?= $form->field($model, 'at_project')->dropDownList(
$model->getBusyness(),
[
'prompt' => 'Выберите'
]
) ?>
</div>
</div>
<div class="row">
<div class="col-xs-12">

View File

@ -35,6 +35,8 @@ use yii\widgets\ActiveForm;
<?php // echo $form->field($model, 'updated_at') ?>
<?php // echo $form->field($model, 'at_project') ?>
<div class="form-group">
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>

View File

@ -59,6 +59,13 @@ $this->params['breadcrumbs'][] = $this->title;
],
]),
],
[
'attribute' => 'at_project',
'value' => function ($model) {
return $model->getBusynessForUser($model->at_project);
},
'filter' => \common\models\UserCard::getBusyness(),
],
//'created_at',
//'updated_at',
[

View File

@ -8,6 +8,10 @@
$menuItems[] = ['label' => $status, 'icon' => 'id-card', 'url' => ['/card/user-card?UserCardSearch[status]=' . $key], 'active' => \Yii::$app->controller->id == 'user-card',];
}
$busynessArr = \common\models\UserCard::getBusyness();
foreach ($busynessArr as $key => $busyness) {
$menuItems[] = ['label' => $busyness, 'icon' => 'id-card', 'url' => ['/card/user-card?UserCardSearch[at_project]=' . $key], 'active' => \Yii::$app->controller->id == 'user-card'];
}
$projectStatuses = \common\models\Status::getStatusesArray(\common\models\UseStatus::USE_PROJECT);
$projectItems = [['label' => 'Все', 'icon' => 'cubes', 'url' => ['/project/project'], 'active' => \Yii::$app->controller->id == 'project']];
foreach ($projectStatuses as $key => $status) {