$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, 'type' => $this->type, //'summ' => $this->summ, 'dt_add' => $this->dt_add, ]); //Debug::dd($this); if($this->dt_from && $this->dt_to){ $query->where(['between', 'dt_add', strtotime($this->$this->dt_from), strtotime($this->$this->dt_to)]); } if($this->dt_from){ $query->where(['>', 'dt_add', strtotime($this->$this->dt_from)]); } $summ_from = $this->summ_from ?: 0; $summ_to = $this->summ_to ?: 9999999999; $query->andFilterWhere(['between', 'summ', $summ_from, $summ_to]); return $dataProvider; } }