Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Auftrag::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(['id' => $this->id, 'gruppe_auftrag' => $this->gruppe_auftrag, 'anfahrtszeit_min' => $this->anfahrtszeit_min, 'start' => $this->start, 'ziel' => $this->ziel, 'start_ort' => $this->start_ort, 'ziel_ort' => $this->ziel_ort, 'ladung' => $this->ladung, 'fahrzeugtyp' => $this->fahrzeugtyp, 'nachfrage_fahrer' => $this->nachfrage_fahrer, 'nachfrage' => $this->nachfrage, 'rueckmeldung_fahrer' => $this->rueckmeldung_fahrer, 'rueckmeldung' => $this->rueckmeldung, 'angelegt' => $this->angelegt, 'angelegt_fahrer' => $this->angelegt_fahrer, 'stuetzpunkt' => $this->stuetzpunkt, 'last_update' => $this->last_update, 'last_update_fahrer' => $this->last_update_fahrer]);
     $query->andFilterWhere(['like', 'auftraggeber_name', $this->auftraggeber_name])->andFilterWhere(['like', 'auftraggeber_abteilung', $this->auftraggeber_abteilung])->andFilterWhere(['like', 'auftraggeber_telefon', $this->auftraggeber_telefon])->andFilterWhere(['like', 'start_name', $this->start_name])->andFilterWhere(['like', 'start_telefon', $this->start_telefon])->andFilterWhere(['like', 'ziel_name', $this->ziel_name])->andFilterWhere(['like', 'ziel_telefon', $this->ziel_telefon]);
     return $dataProvider;
 }
Example #2
0
 /**
  * Finds the Auftrag model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Auftrag the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Auftrag::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }