/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = SystemParams::find()->where('status=0'); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['Id' => $this->Id, 'status' => $this->status, 'createdOn' => $this->createdOn, 'updatedOn' => $this->updatedOn, 'createdBy' => $this->createdBy, 'updatedBy' => $this->updatedBy]); $query->andFilterWhere(['like', 'param', $this->param])->andFilterWhere(['like', 'table', $this->table])->andFilterWhere(['like', 'key', $this->key])->andFilterWhere(['like', 'label', $this->label])->andFilterWhere(['like', 'value', $this->value])->andFilterWhere(['like', 'ip', $this->ip]); return $dataProvider; }
/** * Finds the SystemParams model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return SystemParams the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = SystemParams::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }