Пример #1
0
 public function search($params)
 {
     $query = GlobalConfigModel::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['create_by' => $this->create_by, 'update_by' => $this->update_by]);
     $query->andFilterWhere(['like', 'group', $this->group])->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'value', $this->value])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'create_at', $this->create_at])->andFilterWhere(['like', 'update_at', $this->update_at]);
     return $dataProvider;
 }
Пример #2
0
/**
 * @var yii\web\View $this
 * @var biz\master\models\GlobalConfig $model
 * @var yii\widgets\ActiveForm $form
 */
?>

<div class="global-config-form">

    <?php 
$form = ActiveForm::begin();
?>
    <div class="box box-primary">
        <div class="box-body">
            <?php 
$groups = GlobalConfig::find()->select('group')->distinct(true)->column();
echo $form->field($model, 'group')->widget('yii\\jui\\AutoComplete', ['options' => ['class' => 'form-control', 'maxlength' => 16], 'clientOptions' => ['source' => $groups]]);
?>

            <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => 32]);
?>

            <?php 
echo $form->field($model, 'value')->textInput();
?>

            <?php 
echo $form->field($model, 'description')->textInput(['maxlength' => 128]);
?>