From ddebd16b449ac753854a5dfd97c46292ab88c493 Mon Sep 17 00:00:00 2001 From: Yarik Date: Fri, 12 Feb 2016 11:14:50 +0200 Subject: [PATCH] test --- .htaccess | 3 +++ common/models/BlogSearch.php | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ common/models/GallerySearch.php | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ common/models/ProjectSearch.php | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 309 insertions(+), 0 deletions(-) create mode 100644 common/models/BlogSearch.php create mode 100644 common/models/GallerySearch.php create mode 100644 common/models/ProjectSearch.php diff --git a/.htaccess b/.htaccess index 17d3b8c..e1771ea 100644 --- a/.htaccess +++ b/.htaccess @@ -1,4 +1,7 @@ AddDefaultCharset utf-8 + +php_value error_reporting “E_ALL” + diff --git a/common/models/BlogSearch.php b/common/models/BlogSearch.php new file mode 100644 index 0000000..f6bcc26 --- /dev/null +++ b/common/models/BlogSearch.php @@ -0,0 +1,76 @@ + $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([ + 'blog_id' => $this->blog_id, + 'user_id' => $this->user_id, + 'date_add' => $this->date_add, + 'user_add_id' => $this->user_add_id, + 'view_count' => $this->view_count, + ]); + + $query->andFilterWhere(['like', 'name', $this->name]) + ->andFilterWhere(['like', 'link', $this->link]) + ->andFilterWhere(['like', 'description', $this->description]) + ->andFilterWhere(['like', 'cover', $this->cover]); + + return $dataProvider; + } +} diff --git a/common/models/GallerySearch.php b/common/models/GallerySearch.php new file mode 100644 index 0000000..e5de975 --- /dev/null +++ b/common/models/GallerySearch.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; + } + + // grid filtering conditions + $query->andFilterWhere([ + 'gallery_id' => $this->gallery_id, + 'user_id' => $this->user_id, + 'date_add' => $this->date_add, + 'user_add_id' => $this->user_add_id, + 'type' => $this->type, + ]); + + $query->andFilterWhere(['like', 'name', $this->name]) + ->andFilterWhere(['like', 'cover', $this->cover]) + ->andFilterWhere(['like', 'photo', $this->photo]); + + return $dataProvider; + } +} diff --git a/common/models/ProjectSearch.php b/common/models/ProjectSearch.php new file mode 100644 index 0000000..f15ad0d --- /dev/null +++ b/common/models/ProjectSearch.php @@ -0,0 +1,155 @@ + $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->joinWith('specializations'); + + // grid filtering conditions + $query->andFilterWhere([ + 'project_id' => $this->project_id, + 'user_id' => $this->user_id, + 'project_pid' => $this->project_pid, + 'date_add' => $this->date_add, + 'date_end' => $this->date_end, + 'user_add_id' => $this->user_add_id, + 'view_count' => $this->view_count, + 'payment_variant' => $this->payment_variant, + 'deadline' => $this->deadline, + 'contractual' => $this->contractual, + ]); + + $query->andFilterWhere([ + 'like', + 'name', + $this->name, + ]) + ->andFilterWhere([ + 'like', + 'link', + $this->link, + ]) + ->andFilterWhere([ + 'like', + 'budget', + $this->budget, + ]) + ->andFilterWhere([ + 'like', + 'city', + $this->city, + ]) + ->andFilterWhere([ + 'like', + 'street', + $this->street, + ]) + ->andFilterWhere([ + 'like', + 'house', + $this->house, + ]) + ->andFilterWhere([ + 'like', + 'description', + $this->description, + ]) + ->andFilterWhere([ + 'like', + 'file', + $this->file, + ]) + ->andFilterWhere([ + 'like', + 'specialization.specialization_name', + $this->specializationString, + ]); + + return $dataProvider; + } + } -- libgit2 0.21.4