Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = ClnSubActivity::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(['SUB_ACTIVITY_GEN_NO' => $this->SUB_ACTIVITY_GEN_NO, 'SPORT_GEN_NO' => $this->SPORT_GEN_NO, 'QTY_HEALTH' => $this->QTY_HEALTH, 'QTY_AID' => $this->QTY_AID, 'QTY_DOC' => $this->QTY_DOC, 'QTY_TRAIN' => $this->QTY_TRAIN, 'CREATE_DATE' => $this->CREATE_DATE, 'UPDATE_DATE' => $this->UPDATE_DATE, 'VERSION' => $this->VERSION]);
     $query->andFilterWhere(['like', 'ACTIVITY_DATE', $this->ACTIVITY_DATE])->andFilterWhere(['like', 'CREATE_BY', $this->CREATE_BY])->andFilterWhere(['like', 'UPDATE_BY', $this->UPDATE_BY]);
     return $dataProvider;
 }
 /**
  * Finds the ClnSubActivity model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return ClnSubActivity the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = ClnSubActivity::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }