Ejemplo n.º 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', 'config_group', $this->config_group])->andFilterWhere(['like', 'config_name', $this->config_name])->andFilterWhere(['like', 'config_value', $this->config_value])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'create_date', $this->create_date])->andFilterWhere(['like', 'update_date', $this->update_date]);
     return $dataProvider;
 }
Ejemplo n.º 2
0
use biz\models\GlobalConfig;
/**
 * @var yii\web\View $this
 * @var biz\models\GlobalConfig $model
 * @var yii\widgets\ActiveForm $form
 */
?>

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

	<?php 
$form = ActiveForm::begin();
?>

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

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

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

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