/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Jobdesc::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, 'JOBGRADE_STS' => $this->JOBGRADE_STS, 'SORT' => $this->SORT, 'GF_ID' => $this->GF_ID, 'SEQ_ID' => $this->SEQ_ID, 'UPDATED_TIME' => $this->UPDATED_TIME, 'STATUS' => $this->STATUS]); $query->andFilterWhere(['like', 'JOBSDESK_TITLE', $this->JOBSDESK_TITLE])->andFilterWhere(['like', 'JOBGRADE_NM', $this->JOBGRADE_NM])->andFilterWhere(['like', 'JOBGRADE_DCRP', $this->JOBGRADE_DCRP])->andFilterWhere(['like', 'JOBSDESK_IMG', $this->JOBSDESK_IMG])->andFilterWhere(['like', 'JOBSDESK_PATH', $this->JOBSDESK_PATH])->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 Jobdesc model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Jobdesc the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Jobdesc::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }