/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Suspense::find(); $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' => $this->id, 'customer_id' => $this->customer_id, 'timestamp' => $this->timestamp]); $query->andFilterWhere(['like', 'mpesa_id', $this->mpesa_id])->andFilterWhere(['like', 'original', $this->original])->andFilterWhere(['like', 'destination', $this->destination])->andFilterWhere(['like', 'test', $this->test])->andFilterWhere(['like', 'mpesa_code', $this->mpesa_code])->andFilterWhere(['like', 'mpesa_acc', $this->mpesa_acc])->andFilterWhere(['like', 'mpesa_msidn', $this->mpesa_msidn])->andFilterWhere(['like', 'mpesa_amount', $this->mpesa_amount])->andFilterWhere(['like', 'mpesa_sender', $this->mpesa_sender])->andFilterWhere(['like', 'actual_uri', $this->actual_uri]); return $dataProvider; }
/** * Lists all Suspense models. * @return mixed */ public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => Suspense::find()]); return $this->render('index', ['dataProvider' => $dataProvider]); }