/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Cardids::find(); // add conditions that should always apply here $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; } // grid filtering conditions $query->andFilterWhere(['issuer_id' => $this->issuer_id, 'owner_id' => $this->owner_id, 'scheme_id' => $this->scheme_id, 'enabled' => $this->enabled, 'debit' => $this->debit, 'limscheme_id' => $this->limscheme_id, 'changed' => $this->changed, 'issuedate' => $this->issuedate, 'pincode' => $this->pincode, 'usercode' => $this->usercode, 'state' => $this->state, 'bonus_scheme_id' => $this->bonus_scheme_id, 'usebonus' => $this->usebonus, 'extbonus_id' => $this->extbonus_id, 'bfdate' => $this->bfdate, 'use_only_money_purse' => $this->use_only_money_purse, 't_closedt' => $this->t_closedt, 't_azscode' => $this->t_azscode, 't_talon' => $this->t_talon, 'use_fa' => $this->use_fa, 'cmc' => $this->cmc, 'use_online' => $this->use_online, 'prev_enabled' => $this->prev_enabled]); $query->andFilterWhere(['like', 'card_id', $this->card_id])->andFilterWhere(['like', 'finaldate', $this->finaldate])->andFilterWhere(['like', 'note', $this->note])->andFilterWhere(['like', 'vcard_id', $this->vcard_id]); return $dataProvider; }
/** * Finds the Cardids model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $issuer_id * @param string $card_id * @return Cardids the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($issuer_id, $card_id) { if (($model = Cardids::findOne(['issuer_id' => $issuer_id, 'card_id' => $card_id])) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }