From b0c2940cdfb844af055d1d629c92407e22a6c82a Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Thu, 5 Dec 2019 19:24:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=BF=90=E8=B4=B9=E6=A8=A1?= =?UTF-8?q?=E6=9D=BFsearch=E4=B8=AD=E7=9A=84=E6=97=A0=E7=94=A8=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shop/models/searchs/ExpressTemplateSearch.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/backend/modules/shop/models/searchs/ExpressTemplateSearch.php b/backend/modules/shop/models/searchs/ExpressTemplateSearch.php index 8cee01c..73fe403 100755 --- a/backend/modules/shop/models/searchs/ExpressTemplateSearch.php +++ b/backend/modules/shop/models/searchs/ExpressTemplateSearch.php @@ -26,8 +26,8 @@ class ExpressTemplateSearch extends ExpressTemplate public function rules() { return [ - [['id', 'calculation_type', 'basic_price', 'basic_count', 'extra_price', 'extra_count', 'updated_at', 'created_at'], 'integer'], - [['name', 'province', 'city', 'area'], 'safe'], + [['id', 'calculation_type', 'updated_at', 'created_at'], 'integer'], + [['name'], 'safe'], ['created_at_range','safe'], ]; } @@ -122,18 +122,11 @@ class ExpressTemplateSearch extends ExpressTemplate $query->andFilterWhere([ 'id' => $this->id, 'calculation_type' => $this->calculation_type, - 'basic_price' => $this->basic_price, - 'basic_count' => $this->basic_count, - 'extra_price' => $this->extra_price, - 'extra_count' => $this->extra_count, 'updated_at' => $this->updated_at, 'created_at' => $this->created_at, ]); - $query->andFilterWhere(['like', 'name', $this->name]) - ->andFilterWhere(['like', 'province', $this->province]) - ->andFilterWhere(['like', 'city', $this->city]) - ->andFilterWhere(['like', 'area', $this->area]); + $query->andFilterWhere(['like', 'name', $this->name]); if ($this->created_at_range) { $arr = explode(' ~ ', $this->created_at_range); $start = strtotime($arr[0]);