From a45352682236b330256ed1cf6b09387f3384c98d Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 5 Oct 2015 14:21:09 +0300 Subject: [PATCH] Importers CRUD --- common/config/main.php | 1 + common/models/UserSearch.php | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 0 deletions(-) create mode 100644 common/models/UserSearch.php diff --git a/common/config/main.php b/common/config/main.php index 5d0eb7b..bccb223 100644 --- a/common/config/main.php +++ b/common/config/main.php @@ -1,5 +1,6 @@ 'ru-RU', 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', 'components' => [ 'cache' => [ diff --git a/common/models/UserSearch.php b/common/models/UserSearch.php new file mode 100644 index 0000000..da031c5 --- /dev/null +++ b/common/models/UserSearch.php @@ -0,0 +1,75 @@ + $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, + 'is_super' => $this->is_super, + 'office_id' => $this->office_id, + 'acl_accounts_access' => $this->acl_accounts_access, + 'active' => $this->active, + ]); + + $query->andFilterWhere(['like', 'login', $this->login]) + ->andFilterWhere(['like', 'password', $this->password]) + ->andFilterWhere(['like', 'email', $this->email]) + ->andFilterWhere(['like', 'name', $this->name]) + ->andFilterWhere(['like', 'photo', $this->photo]) + ->andFilterWhere(['like', 'contacts', $this->contacts]); + + return $dataProvider; + } +} -- libgit2 0.21.4