/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Progressjob::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(['PROGRESS_ID' => $this->PROGRESS_ID, 'STAR_DATE' => $this->STAR_DATE, 'END_DATE' => $this->END_DATE, 'STATUS' => $this->STATUS]); $query->andFilterWhere(['like', 'USER_ID', $this->USER_ID])->andFilterWhere(['like', 'MODUL', $this->MODUL])->andFilterWhere(['like', 'JUDUL', $this->JUDUL])->andFilterWhere(['like', 'KETERANGAN', $this->KETERANGAN])->andFilterWhere(['like', 'PROGRESS', $this->PROGRESS])->andFilterWhere(['like', 'KETERANGAN_DETAIL', $this->KETERANGAN_DETAIL]); return $dataProvider; }
/** * Finds the Progressjob model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Progressjob the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Progressjob::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }