/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = EfProject::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(['PROJECT_ID' => $this->PROJECT_ID, 'PROJECT_TYPE_ID' => $this->PROJECT_TYPE_ID, 'UNIT_ID' => $this->UNIT_ID, 'DIVISION_ID' => $this->DIVISION_ID, 'START_DATE' => $this->START_DATE, 'END_DATE' => $this->END_DATE, 'BUDGET_TYPE_ID' => $this->BUDGET_TYPE_ID, 'BUDGET_RECEIVE' => $this->BUDGET_RECEIVE, 'BUDGET_ACTUAL' => $this->BUDGET_ACTUAL, 'PROJ_HDLR_ID' => $this->PROJ_HDLR_ID, 'CREATE_BY' => $this->CREATE_BY, 'CREATE_DATE' => $this->CREATE_DATE, 'LAST_UPD_BY' => $this->LAST_UPD_BY, 'LAST_UPD_DATE' => $this->LAST_UPD_DATE]); $query->andFilterWhere(['like', 'FISCAL_YEAR', $this->FISCAL_YEAR])->andFilterWhere(['like', 'PLAN_NAME', $this->PLAN_NAME])->andFilterWhere(['like', 'MAIN_PRODUCTIVITY', $this->MAIN_PRODUCTIVITY])->andFilterWhere(['like', 'PROJECT_NAME', $this->PROJECT_NAME])->andFilterWhere(['like', 'PROJECT_STATUS', $this->PROJECT_STATUS])->andFilterWhere(['like', 'CONTRACT_NUM', $this->CONTRACT_NUM])->andFilterWhere(['like', 'PLACE', $this->PLACE])->andFilterWhere(['like', 'AMPHOE_CODE', $this->AMPHOE_CODE])->andFilterWhere(['like', 'PROVINCE_CODE', $this->PROVINCE_CODE])->andFilterWhere(['like', 'PRINC_N_REASON', $this->PRINC_N_REASON])->andFilterWhere(['like', 'OBJECTIVE', $this->OBJECTIVE])->andFilterWhere(['like', 'TARGET', $this->TARGET])->andFilterWhere(['like', 'TARGET_GROUP', $this->TARGET_GROUP])->andFilterWhere(['like', 'OUTPUT', $this->OUTPUT])->andFilterWhere(['like', 'INDICATOR', $this->INDICATOR])->andFilterWhere(['like', 'RESULT', $this->RESULT])->andFilterWhere(['like', 'SCOPE', $this->SCOPE])->andFilterWhere(['like', 'PLAN', $this->PLAN]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getEfProjects() { return $this->hasMany(EfProject::className(), ['DIVISION_ID' => 'DIVISION_ID']); }
/** * @return \yii\db\ActiveQuery */ public function getProject() { return $this->hasOne(EfProject::className(), ['PROJECT_ID' => 'PROJECT_ID']); }
/** * @return \yii\db\ActiveQuery */ public function getEfProjects() { return $this->hasMany(EfProject::className(), ['PROJECT_TYPE_ID' => 'PROJECT_TYPE_ID']); }
/** * Finds the EfProject model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return EfProject the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = EfProject::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }