Пример #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = PetrolVecfil012::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_CARD' => $this->ID_CARD, 'ID_BELONGING' => $this->ID_BELONGING, 'ID_CLIENT' => $this->ID_CLIENT, 'ID_CONDITION' => $this->ID_CONDITION, 'CARD_NUMBER' => $this->CARD_NUMBER, 'TYPE_CARD' => $this->TYPE_CARD, 'PHYSICALLY_CARD' => $this->PHYSICALLY_CARD, 'ID_PERSONNEL' => $this->ID_PERSONNEL, 'NUMBER_TERMINAL' => $this->NUMBER_TERMINAL, 'NEW_CARD' => $this->NEW_CARD, 'ID_FIRM_IN_CARD' => $this->ID_FIRM_IN_CARD, 'ID_FILIAL_IN_CARD' => $this->ID_FILIAL_IN_CARD, 'ID_LOYALTY_PATTERN' => $this->ID_LOYALTY_PATTERN, 'DETALING_ID' => $this->DETALING_ID]);
     $query->andFilterWhere(['like', 'DESCRIPTION_BELONGING', $this->DESCRIPTION_BELONGING])->andFilterWhere(['like', 'DESCRIPTION_CONDITION', $this->DESCRIPTION_CONDITION])->andFilterWhere(['like', 'DESCRIPTION_TYPE_CARD', $this->DESCRIPTION_TYPE_CARD])->andFilterWhere(['like', 'DESCRIPTION_PHYSICALLY', $this->DESCRIPTION_PHYSICALLY])->andFilterWhere(['like', 'DATE_CARD', $this->DATE_CARD])->andFilterWhere(['like', 'REASON_NOT_WORKING_CONDITION', $this->REASON_NOT_WORKING_CONDITION])->andFilterWhere(['like', 'HOLDER_CARD', $this->HOLDER_CARD])->andFilterWhere(['like', 'PROTECTION_PIN', $this->PROTECTION_PIN])->andFilterWhere(['like', 'EXP_DATE', $this->EXP_DATE])->andFilterWhere(['like', 'PAN_CODE_CARD', $this->PAN_CODE_CARD])->andFilterWhere(['like', 'PIN_CODE_CARD', $this->PIN_CODE_CARD])->andFilterWhere(['like', 'E_MAIL', $this->E_MAIL])->andFilterWhere(['like', 'DET_MESSAGE1', $this->DET_MESSAGE1])->andFilterWhere(['like', 'DET_MESSAGE2', $this->DET_MESSAGE2]);
     return $dataProvider;
 }
Пример #2
0
 public function getpetrolcards()
 {
     return $this->hasMany(PetrolVecfil012::className(), ['ID_FIRM_IN_CARD' => 'ID_in_ExtSystem']);
 }
Пример #3
0
 /**
  * Finds the PetrolVecfil012 model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return PetrolVecfil012 the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = PetrolVecfil012::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }