96 lines
3.4 KiB
PHP
Executable File
96 lines
3.4 KiB
PHP
Executable File
<?php
|
|
|
|
namespace backend\modules\cms\models;
|
|
|
|
use yii\base\Model;
|
|
use yii\data\ActiveDataProvider;
|
|
use common\models\Handicapped;
|
|
|
|
/**
|
|
* HandicappedSearch represents the model behind the search form of `common\models\Handicapped`.
|
|
*/
|
|
class HandicappedSearch extends Handicapped
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
[['id', 'income_m', 'bank_id', 'created_at', 'updated_at', 'status'], 'integer'],
|
|
[['title', 'name', 'bdate', 'nation', 'status_marital', 'status_type', 'refer_contract', 'gov_welfare', 'jobs', 'get_training', 'get_money', 'bank_type', 'bank_name', 'id_card', 'address', 'tel', 'email', 'topic', 'description', 'process', 'files', 'proceed', 'remark'], 'safe'],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function scenarios()
|
|
{
|
|
// bypass scenarios() implementation in the parent class
|
|
return Model::scenarios();
|
|
}
|
|
|
|
/**
|
|
* Creates data provider instance with search query applied
|
|
*
|
|
* @param array $params
|
|
*
|
|
* @return ActiveDataProvider
|
|
*/
|
|
public function search($params)
|
|
{
|
|
$query = Handicapped::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([
|
|
'id' => $this->id,
|
|
'income_m' => $this->income_m,
|
|
'bank_id' => $this->bank_id,
|
|
'created_at' => $this->created_at,
|
|
'updated_at' => $this->updated_at,
|
|
'status' => $this->status,
|
|
]);
|
|
|
|
$query->andFilterWhere(['like', 'title', $this->title])
|
|
->andFilterWhere(['like', 'name', $this->name])
|
|
->andFilterWhere(['like', 'bdate', $this->bdate])
|
|
->andFilterWhere(['like', 'nation', $this->nation])
|
|
->andFilterWhere(['like', 'status_marital', $this->status_marital])
|
|
->andFilterWhere(['like', 'status_type', $this->status_type])
|
|
->andFilterWhere(['like', 'refer_contract', $this->refer_contract])
|
|
->andFilterWhere(['like', 'gov_welfare', $this->gov_welfare])
|
|
->andFilterWhere(['like', 'jobs', $this->jobs])
|
|
->andFilterWhere(['like', 'get_training', $this->get_training])
|
|
->andFilterWhere(['like', 'get_money', $this->get_money])
|
|
->andFilterWhere(['like', 'bank_type', $this->bank_type])
|
|
->andFilterWhere(['like', 'bank_name', $this->bank_name])
|
|
->andFilterWhere(['like', 'id_card', $this->id_card])
|
|
->andFilterWhere(['like', 'address', $this->address])
|
|
->andFilterWhere(['like', 'tel', $this->tel])
|
|
->andFilterWhere(['like', 'email', $this->email])
|
|
->andFilterWhere(['like', 'topic', $this->topic])
|
|
->andFilterWhere(['like', 'description', $this->description])
|
|
->andFilterWhere(['like', 'process', $this->process])
|
|
->andFilterWhere(['like', 'files', $this->files])
|
|
->andFilterWhere(['like', 'proceed', $this->proceed])
|
|
->andFilterWhere(['like', 'remark', $this->remark]);
|
|
|
|
return $dataProvider;
|
|
}
|
|
}
|