/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Logs::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, 'fecha_registro' => $this->fecha_registro, 'hora_registro' => $this->hora_registro]); $query->andFilterWhere(['like', 'nombre', $this->nombre])->andFilterWhere(['like', 'role', $this->role])->andFilterWhere(['like', 'module', $this->module])->andFilterWhere(['like', 'submodule', $this->submodule])->andFilterWhere(['like', 'result', $this->result])->andFilterWhere(['like', 'info', $this->info])->andFilterWhere(['like', 'ip_address', $this->ip_address]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Logs::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, 'model_id' => $this->model_id, 'created' => $this->created]); $query->andFilterWhere(['like', 'model', $this->model])->andFilterWhere(['like', 'description', $this->description]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Logs::find()->orderBy(['id' => SORT_DESC]); // add conditions that should always apply here $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; } // grid filtering conditions $query->andFilterWhere(['id' => $this->id, 'date' => $this->date]); $query->andFilterWhere(['like', 'logs', $this->logs]); return $dataProvider; }