/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Visi::find()->where('STATUS <>3'); $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, 'TGL' => $this->TGL, 'SET_ACTIVE' => $this->SET_ACTIVE, 'GF_ID' => $this->GF_ID, 'SEQ_ID' => $this->SEQ_ID, 'UPDATED_TIME' => $this->UPDATED_TIME, 'STATUS' => $this->STATUS]); $query->andFilterWhere(['like', 'VISIMISI_TITEL', $this->VISIMISI_TITEL])->andFilterWhere(['like', 'VISIMISI_ISI', $this->VISIMISI_ISI])->andFilterWhere(['like', 'VISIMISI_DCRPT', $this->VISIMISI_DCRPT])->andFilterWhere(['like', 'VISIMISI_IMG', $this->VISIMISI_IMG])->andFilterWhere(['like', 'CORP_ID', $this->CORP_ID])->andFilterWhere(['like', 'DEP_ID', $this->DEP_ID])->andFilterWhere(['like', 'DEP_SUB_ID', $this->DEP_SUB_ID])->andFilterWhere(['like', 'JOBGRADE_ID', $this->JOBGRADE_ID])->andFilterWhere(['like', 'CREATED_BY', $this->CREATED_BY])->andFilterWhere(['like', 'UPDATED_BY', $this->UPDATED_BY]); return $dataProvider; }
/** * Finds the Visi model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param string $id * @return Visi the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Visi::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }