/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = BankMaster::find()->where(['is_status' => 0]); $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['bank_master_id' => SORT_DESC]]]); $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(['bank_master_id' => $this->bank_master_id, 'created_at' => $this->created_at, 'created_by' => $this->created_by, 'updated_at' => $this->updated_at, 'updated_by' => $this->updated_by, 'is_status' => $this->is_status]); $query->andFilterWhere(['like', 'bank_master_name', $this->bank_master_name])->andFilterWhere(['like', 'bank_alias', $this->bank_alias]); unset($_SESSION['exportData']); $_SESSION['exportData'] = $dataProvider; return $dataProvider; }
/** * Finds the BankMaster model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return BankMaster the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = BankMaster::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getFeesPayTranBank() { return $this->hasOne(BankMaster::className(), ['bank_master_id' => 'fees_pay_tran_bank_id']); }