/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Level::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'lesson' => $this->lesson, 'credit' => $this->credit, 'score' => $this->score, 'login_duration' => $this->login_duration, 'register_fee' => $this->register_fee, 'create_time' => $this->create_time, 'update_time' => $this->update_time]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'content', $this->content])->andFilterWhere(['like', 'update_user', $this->update_user]); return $dataProvider; }
<div class="col-sm-6 col-md-6 col-md-6"> <?php echo $form->field($model, 'program_text')->textInput(['maxlength' => true]); ?> </div> <div class="col-sm-6 col-md-6"> <?php echo $form->field($model, 'risk_simple')->widget(Select2::classname(), ['data' => ArrayHelper::map(Simple::find()->all(), 'SIMPLE_ID', 'SIMPLE_NAME'), 'options' => ['placeholder' => 'เลือกหัวข้อตาม simple ...'], 'pluginOptions' => ['allowClear' => true]]); ?> </div> <div class="col-sm-6 col-md-6"> <?php echo $form->field($model, 'risk_level')->widget(Select2::classname(), ['data' => ArrayHelper::map(Level::find()->all(), 'level', 'name'), 'options' => ['placeholder' => 'เลือกระดับความรุนแรง ...'], 'pluginOptions' => ['allowClear' => true]]); ?> </div> <div class="col-sm-6 col-md-6 col-md-6"> <?php echo $form->field($model, 'input_complain')->widget(Select2::classname(), ['data' => ArrayHelper::map(\app\models\Complain::find()->all(), 'COMPLAIN_ID', 'COMPLAIN_NAME'), 'options' => ['placeholder' => 'เลือกช่องทางรับเรื่องร้องเรียน ...'], 'pluginOptions' => ['allowClear' => true]]); ?> </div> <?php