Commit 7a6df601d0da9895c77c8a9fd397a975f4840ce6
1 parent
c83499b4
-Second phone search
Showing
1 changed file
with
15 additions
and
7 deletions
Show diff stats
models/OrderSearch.php
@@ -76,8 +76,8 @@ | @@ -76,8 +76,8 @@ | ||
76 | 76 | ||
77 | $dataProvider = new ActiveDataProvider( | 77 | $dataProvider = new ActiveDataProvider( |
78 | [ | 78 | [ |
79 | - 'query' => $query, | ||
80 | - 'sort' => [ 'defaultOrder' => [ 'id' => SORT_DESC ] ], | 79 | + 'query' => $query, |
80 | + 'sort' => [ 'defaultOrder' => [ 'id' => SORT_DESC ] ], | ||
81 | 'pagination' => [ | 81 | 'pagination' => [ |
82 | 'pageSize' => 50, | 82 | 'pageSize' => 50, |
83 | ], | 83 | ], |
@@ -94,7 +94,7 @@ | @@ -94,7 +94,7 @@ | ||
94 | return $dataProvider; | 94 | return $dataProvider; |
95 | } | 95 | } |
96 | 96 | ||
97 | - if (!empty( $this->sku )) { | 97 | + if (!empty($this->sku)) { |
98 | $query->innerJoinWith('products.productVariant') | 98 | $query->innerJoinWith('products.productVariant') |
99 | ->andWhere( | 99 | ->andWhere( |
100 | [ | 100 | [ |
@@ -126,9 +126,17 @@ | @@ -126,9 +126,17 @@ | ||
126 | ); | 126 | ); |
127 | $query->andFilterWhere( | 127 | $query->andFilterWhere( |
128 | [ | 128 | [ |
129 | - 'like', | ||
130 | - 'phone', | ||
131 | - $this->phone, | 129 | + 'or', |
130 | + [ | ||
131 | + 'like', | ||
132 | + 'phone', | ||
133 | + $this->phone, | ||
134 | + ], | ||
135 | + [ | ||
136 | + 'like', | ||
137 | + 'phone2', | ||
138 | + $this->phone, | ||
139 | + ], | ||
132 | ] | 140 | ] |
133 | ); | 141 | ); |
134 | $query->andFilterWhere( | 142 | $query->andFilterWhere( |
@@ -169,7 +177,7 @@ | @@ -169,7 +177,7 @@ | ||
169 | 'delivery' => $this->delivery, | 177 | 'delivery' => $this->delivery, |
170 | ] | 178 | ] |
171 | ); | 179 | ); |
172 | - if (!empty( $this->date_range )) { | 180 | + if (!empty($this->date_range)) { |
173 | $this->date_from = strtotime(explode('to', $this->date_range)[ 0 ]); | 181 | $this->date_from = strtotime(explode('to', $this->date_range)[ 0 ]); |
174 | $this->date_to = strtotime(explode('to', $this->date_range)[ 1 ]); | 182 | $this->date_to = strtotime(explode('to', $this->date_range)[ 1 ]); |
175 | 183 |