/** * Finds the PaymentsReceived model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return PaymentsReceived the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = PaymentsReceived::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = PaymentsReceived::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, 'aggregator' => $this->aggregator, 'aggregator_payment_processed_date' => $this->aggregator_payment_processed_date, 'date_received' => $this->date_received, 'amount' => $this->amount, 'sticker_generated' => $this->sticker_generated]); $query->orFilterWhere(['ilike', 'aggregator_transaction_id', $this->modelSearch])->orFilterWhere(['ilike', 'vehicle_reference', $this->modelSearch])->orFilterWhere(['ilike', 'aggregator_payment_reference', $this->modelSearch])->orFilterWhere(['ilike', 'aggregator_memo', $this->modelSearch])->orFilterWhere(['ilike', 'payer_mobile', $this->modelSearch])->orFilterWhere(['ilike', 'payer_email', $this->modelSearch])->orFilterWhere(['ilike', 'payer_name', $this->modelSearch])->orFilterWhere(['ilike', 'payment_recon_flag', $this->modelSearch])->orFilterWhere(['ilike', 'payment_status', $this->modelSearch]); unset($_SESSION['exportData']); $_SESSION['exportData'] = $dataProvider; return $dataProvider; }