private function findModel($id) { if (($model = SysCountAll::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = SysCountAll::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['person' => $this->person, 'death' => $this->death, 'service' => $this->service, 'accident' => $this->accident, 'diagnosis_opd' => $this->diagnosis_opd, 'procedure_opd' => $this->procedure_opd, 'ncdscreen' => $this->ncdscreen, 'chronicfu' => $this->chronicfu, 'labfu' => $this->labfu, 'chronic' => $this->chronic, 'fp' => $this->fp, 'epi' => $this->epi, 'nutrition' => $this->nutrition, 'prenatal' => $this->prenatal, 'anc' => $this->anc, 'labor' => $this->labor, 'postnatal' => $this->postnatal, 'newborn' => $this->newborn, 'newborncare' => $this->newborncare, 'dental' => $this->dental, 'admission' => $this->admission, 'diagnosis_ipd' => $this->diagnosis_ipd, 'procedure_ipd' => $this->procedure_ipd]); $query->andFilterWhere(['like', 'hospcode', $this->hospcode])->andFilterWhere(['like', 'month', $this->month]); return $dataProvider; }