| Current Path : /var/www/html/chatbot/backend/models/ |
| Current File : /var/www/html/chatbot/backend/models/AdmStatusPermohonanSearch.php |
<?php
namespace backend\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\models\AdmStatusPermohonan; //masukkan nama model tanpa .php atau nama class model
/**
* Ubah nama kelas mengikut nama class model
* AdmNegaraSearch represents the model behind the search form of `backend\models\ContentFaq`.
*/
class AdmStatusPermohonanSearch extends AdmStatusPermohonan
{
/**
* masukkan nama bidang table db
* @inheritdoc
*/
public function rules()
{
return [
[['kod_status_permohonan','aktif','is_penyata','is_view','is_laporan','is_rayuan'], 'integer'],
[['status_permohonan','status_desc','created_date','created_by','modified_by','modified_date'], 'safe'],
];
}
/**
* @inheritdoc
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Ubah atau tambah pada $this-> bidang yang anda hendak masukkan dalam pencarian
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = AdmStatusPermohonan::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([
'kod_status_permohonan' => $this->kod_status_permohonan,
'status_permohonan' => $this->status_permohonan,
'status_desc' => $this->status_desc,
'is_penyata' => $this->is_penyata,
'is_view' => $this->is_view,
'is_rayuan' => $this->is_rayuan,
'created_at' => $this->created_date,
'created_by' => $this->created_by,
'updated_at' => $this->modified_date,
'updated_by' => $this->modified_by,
]);
return $dataProvider;
}
}