Exemple #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = LgReport::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(['kode' => $this->kode, 'tgl_pengiriman' => $this->tgl_pengiriman, 'tgl_terima' => $this->tgl_terima, 'kendaraan' => $this->kendaraan, 'kurir' => $this->kurir, 'status_approve' => $this->status_approve, 'status_pengiriman' => $this->status_pengiriman, 'ongkir' => $this->ongkir]);
     //$query->andFilterWhere(['like', 'tujuan', $this->tujuan]);
     return $dataProvider;
 }
 protected function findModelReport($id)
 {
     if (($model = LgReport::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }