Ejemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = PopulacPreferences::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(['changemark' => $this->changemark, 'id' => $this->id]);
     $query->andFilterWhere(['like', 'codes', $this->codes])->andFilterWhere(['like', 'name1', $this->name1])->andFilterWhere(['like', 'classmark', $this->classmark])->andFilterWhere(['like', 'classmarkcn', $this->classmarkcn]);
     return $dataProvider;
 }
Ejemplo n.º 2
0
 public function actionTest()
 {
     //$model = new PopulacPreferences();
     //echo $model->getName1Text('sstatus', '1');
     header("Content-type: text/html; charset=utf-8");
     $data = PopulacPreferences::find()->indexBy('id')->all();
     echo "<pre>";
     print_r($data);
     echo "</pre";
 }