diff --git a/backend/modules/card/views/user-card/index.php b/backend/modules/card/views/user-card/index.php index 21030e6..2778005 100644 --- a/backend/modules/card/views/user-card/index.php +++ b/backend/modules/card/views/user-card/index.php @@ -34,7 +34,8 @@ $this->params['breadcrumbs'][] = $this->title; }, ], 'fio', - 'passport', + //'passport', + 'salary', 'email:email', //'gender', //'dob', diff --git a/backend/modules/company/models/CompanySearch.php b/backend/modules/company/models/CompanySearch.php index 990e26e..e7ef47e 100644 --- a/backend/modules/company/models/CompanySearch.php +++ b/backend/modules/company/models/CompanySearch.php @@ -2,6 +2,7 @@ namespace backend\modules\company\models; +use common\classes\Debug; use Yii; use yii\base\Model; use yii\data\ActiveDataProvider; @@ -18,7 +19,7 @@ class CompanySearch extends Company public function rules() { return [ - [['id', 'status_id'], 'integer'], + [['id', 'status_id', 'projectId'], 'integer'], [['name', 'description', 'created_at', 'updated_at'], 'safe'], ]; } @@ -41,7 +42,7 @@ class CompanySearch extends Company */ public function search($params) { - $query = Company::find(); + $query = Company::find()->joinWith('project'); // add conditions that should always apply here @@ -63,6 +64,7 @@ class CompanySearch extends Company 'status_id' => $this->status_id, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, + 'project.id' => $this->projectId ]); $query->andFilterWhere(['like', 'name', $this->name]) diff --git a/backend/modules/company/views/company/index.php b/backend/modules/company/views/company/index.php index 8c994f3..d667e7b 100644 --- a/backend/modules/company/views/company/index.php +++ b/backend/modules/company/views/company/index.php @@ -26,8 +26,36 @@ $this->params['breadcrumbs'][] = $this->title; //'id', 'name', - 'description:ntext', - 'status_id', + [ + 'attribute' => 'project.name', + 'label' => 'Проект', + 'filter' => kartik\select2\Select2::widget([ + 'model' => $searchModel, + 'name' => 'CompanySearch[projectId]', + 'data' => \common\models\Project::getList(), + 'options' => ['placeholder' => 'Начните вводить...','class' => 'form-control'], + 'pluginOptions' => [ + 'allowClear' => true + ], + ]), + ], + //'description:ntext', + //'status_id', + [ + 'attribute' => 'status', + 'value' => function($model){ + return isset($model->status0->name) ? $model->status0->name : 'Не задано'; + }, + 'filter' => kartik\select2\Select2::widget([ + 'model' => $searchModel, + 'attribute' => 'status', + 'data' => \common\models\Status::getStatusesArray(\common\models\UseStatus::USE_COMPANY), + 'options' => ['placeholder' => 'Начните вводить...','class' => 'form-control'], + 'pluginOptions' => [ + 'allowClear' => true + ], + ]), + ], //'created_at', //'updated_at', diff --git a/backend/modules/project/views/project/index.php b/backend/modules/project/views/project/index.php index bed75ab..2d73f3c 100644 --- a/backend/modules/project/views/project/index.php +++ b/backend/modules/project/views/project/index.php @@ -1,5 +1,6 @@ params['breadcrumbs'][] = $this->title;
render('_search', ['model' => $searchModel]); ?> - +

'btn btn-success']) ?>

@@ -24,11 +25,29 @@ $this->params['breadcrumbs'][] = $this->title; 'columns' => [ ['class' => 'yii\grid\SerialColumn'], - 'id', - 'name', + //'id', + [ + 'attribute' => 'name', + 'filter' => kartik\select2\Select2::widget([ + 'model' => $searchModel, + 'attribute' => 'name', + 'data' => \common\models\Project::getListName(), + 'options' => ['placeholder' => 'Начните вводить...','class' => 'form-control'], + 'pluginOptions' => [ + 'allowClear' => true + ], + ]), + ], + 'budget', 'description:ntext', - 'created_at', - 'updated_at', + [ + 'label' => 'Исполнители', + 'value' => function($model){ + return implode(', ', $model->getUsersNameList()); + } + ], + //'created_at', + //'updated_at', ['class' => 'yii\grid\ActionColumn'], ], diff --git a/backend/views/layouts/left.php b/backend/views/layouts/left.php index c3a5b5b..1d31b74 100644 --- a/backend/views/layouts/left.php +++ b/backend/views/layouts/left.php @@ -1,5 +1,12 @@