add_type_in_settings

This commit is contained in:
SoHardKI
2019-06-26 17:22:10 +03:00
parent 91e3608c47
commit befb8a96a2
9 changed files with 82 additions and 15 deletions

View File

@ -2,6 +2,7 @@
namespace backend\modules\settings\models;
use common\classes\Debug;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
@ -62,7 +63,7 @@ class AdditionalFieldsSearch extends AdditionalFields
]);
$query->andFilterWhere(['like', 'name', $this->name]);
// Debug::dd($query->createCommand()->rawSql);
return $dataProvider;
}
}

View File

@ -0,0 +1,6 @@
<?php
/**
* @var $model \yii\db\ActiveRecord
*/
echo \common\models\UseField::getStatusesTextById($model->use);

View File

@ -1,7 +1,9 @@
<?php
use yii\data\ActiveDataProvider;
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\ListView;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\card\models\AdditionalFieldsSearch */
@ -23,10 +25,23 @@ $this->params['breadcrumbs'][] = $this->title;
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'name',
[
'label' => 'Доп. информация',
'format' => 'raw',
'value' => function ($model) {
$dataProvider = new ActiveDataProvider([
'query' => $model->getUseFields(),
]);
return ListView::widget([
'dataProvider' => $dataProvider,
'itemView' => '_additional',
'layout' => "{items}",
]);
},
'headerOptions' => ['width' => '300'],
],
['class' => 'yii\grid\ActionColumn'],
],
]); ?>