Пример #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Harga::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(['FWD_ID' => $this->FWD_ID, 'FWD_SERVICE' => $this->FWD_SERVICE, 'FWD_STS' => $this->FWD_STS, 'FWD_DATE_START' => $this->FWD_DATE_START, 'FWD_DATE_UPDATE' => $this->FWD_DATE_UPDATE, 'ORIGIN_PROVINCE' => $this->ORIGIN_PROVINCE, 'ORIGIN_CITY' => $this->ORIGIN_CITY, 'DES_PROVINCE' => $this->DES_PROVINCE, 'DES_CITY' => $this->DES_CITY, 'HARGA' => $this->HARGA, 'STATUS' => $this->STATUS]);
     $query->andFilterWhere(['like', 'FWD_NM', $this->FWD_NM]);
     return $dataProvider;
 }
Пример #2
0
 protected function findModel($id)
 {
     if (($model = Harga::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }