Esempio n. 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Stock_promo::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, 'WAKTU' => $this->WAKTU, 'STOCK_PROMO' => $this->STOCK_PROMO, 'PRODAK_LINE' => $this->PRODAK_LINE, 'UPDATED_TIME' => $this->UPDATED_TIME, 'STATUS' => $this->STATUS]);
     $query->andFilterWhere(['like', 'CUST_KD', $this->CUST_KD])->andFilterWhere(['like', 'CUST_NM', $this->CUST_NM])->andFilterWhere(['like', 'KD_BARANG', $this->KD_BARANG])->andFilterWhere(['like', 'NM_BARANG', $this->NM_BARANG])->andFilterWhere(['like', 'CORP_ID', $this->CORP_ID])->andFilterWhere(['like', 'KD_DISTRIBUTOR', $this->KD_DISTRIBUTOR])->andFilterWhere(['like', 'KD_SUBDIST', $this->KD_SUBDIST])->andFilterWhere(['like', 'CREATED_BY', $this->CREATED_BY])->andFilterWhere(['like', 'UPDATED_BY', $this->UPDATED_BY]);
     return $dataProvider;
 }
 /**
  * Finds the Stock_promo model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Stock_promo the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Stock_promo::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }