/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = HeaderDetail::find(); // add conditions that should always apply here $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; } // grid filtering conditions $query->andFilterWhere(['ID' => $this->ID, 'TGL' => $this->TGL, 'ETD' => $this->ETD, 'ETA' => $this->ETA, 'QTY_UNIT' => $this->QTY_UNIT, 'QTY_PCS' => $this->QTY_PCS, 'HARGA' => $this->HARGA, 'DISCOUNT' => $this->DISCOUNT, 'PAJAK' => $this->PAJAK, 'DELIVERY_COST' => $this->DELIVERY_COST, 'CREATE_AT' => $this->CREATE_AT, 'UPDATE_AT' => $this->UPDATE_AT]); $query->andFilterWhere(['like', 'KD_SJ', $this->KD_SJ])->andFilterWhere(['like', 'KD_SO', $this->KD_SO])->andFilterWhere(['like', 'KD_INVOICE', $this->KD_INVOICE])->andFilterWhere(['like', 'KD_FP', $this->KD_FP])->andFilterWhere(['like', 'KD_BARANG', $this->KD_BARANG])->andFilterWhere(['like', 'NM_BARANG', $this->NM_BARANG])->andFilterWhere(['like', 'NOTE', $this->NOTE])->andFilterWhere(['like', 'CREATE_BY', $this->CREATE_BY])->andFilterWhere(['like', 'UPDATE_BY', $this->UPDATE_BY]); return $dataProvider; }
/** * Finds the HeaderDetail model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return HeaderDetail the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = HeaderDetail::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }