public function search($params) { $query = Payment::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['payment_id' => $this->payment_id, 'customer_id' => $this->customer_id, 'staff_id' => $this->staff_id, 'rental_id' => $this->rental_id, 'amount' => $this->amount, 'payment_date' => $this->payment_date, 'last_update' => $this->last_update]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = PaymentModel::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(['payment_id' => $this->payment_id, 'customer_id' => $this->customer_id, 'staff_id' => $this->staff_id, 'rental_id' => $this->rental_id, 'amount' => $this->amount, 'payment_date' => $this->payment_date, 'last_update' => $this->last_update]); return $dataProvider; }