Exemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Zakaz::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'pay_id' => $this->pay_id, 'store_id' => $this->store_id, 'zakaz_summa' => $this->zakaz_summa, 'zakaz_date' => $this->zakaz_date]);
     $query->andFilterWhere(['like', 'session_id', $this->phpsessid])->andFilterWhere(['like', 'user_id', $this->user_id])->andFilterWhere(['like', 'user_name', $this->user_name])->andFilterWhere(['like', 'user_telephon', $this->user_telephon])->andFilterWhere(['like', 'user_email', $this->user_email])->andFilterWhere(['like', 'adr_city', $this->adr_city])->andFilterWhere(['like', 'adr_adres', $this->adr_adres])->andFilterWhere(['like', 'adr_index', $this->adr_index])->andFilterWhere(['like', 'zakaz', $this->zakaz]);
     return $dataProvider;
 }
Exemplo n.º 2
0
 /**
  * Finds the Zakaz model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Zakaz the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Zakaz::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }