andWhere(['type' => Transfer::TYPE_MONEY_MOVEMENT_OUT]); $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_transfer' => $this->id_transfer, 'id_discount' => $this->id_discount, 'id_currency' => $this->id_currency, 'id_object' => $this->id_object, 'status' => $this->status, 'type' => $this->type, 'item_price' => $this->item_price, 'count' => $this->count, 'money' => $this->money, 'money_currency' => $this->money_currency, 'rate' => $this->rate, 'id_user' => $this->id_user, 'created_at' => $this->created_at, ]); $query->andFilterWhere(['like', 'comment', $this->comment]); return $dataProvider; } }