作者 郭文星

'123'

@@ -155,10 +155,12 @@ class Business extends Base @@ -155,10 +155,12 @@ class Business extends Base
155 $page = $this->request->post('page', 1); 155 $page = $this->request->post('page', 1);
156 $total = $this->request->post('total', 10); 156 $total = $this->request->post('total', 10);
157 $where['a.verification_store_id'] =['=', $this->store_id]; 157 $where['a.verification_store_id'] =['=', $this->store_id];
  158 + $wheres=[];
158 if($keyfield){ 159 if($keyfield){
159 - $where['c.receive_no'] =['like', '%' . $keyfield . '%'];  
160 - $where['e.mobile'] = ['like', '%' . $keyfield . '%']; 160 + $wheres['c.receive_no'] =['like', '%' . $keyfield . '%'];
  161 + $wheres['e.mobile']= ['like', '%' . $keyfield . '%'];
161 } 162 }
  163 +
162 $field = "a.id,a.createtime,b.name,d.name as coupon_name,c.type,DATE_FORMAT(FROM_UNIXTIME(c.closetime), '%Y-%m-%d %H:%i:%S') AS closetime,c.type,c.receive_no"; 164 $field = "a.id,a.createtime,b.name,d.name as coupon_name,c.type,DATE_FORMAT(FROM_UNIXTIME(c.closetime), '%Y-%m-%d %H:%i:%S') AS closetime,c.type,c.receive_no";
163 $cancel=Db::name('verification_cancel') 165 $cancel=Db::name('verification_cancel')
164 ->alias('a') 166 ->alias('a')
@@ -168,6 +170,7 @@ class Business extends Base @@ -168,6 +170,7 @@ class Business extends Base
168 ->field($field) 170 ->field($field)
169 ->join('user e','c.user_id=e.id') 171 ->join('user e','c.user_id=e.id')
170 ->where($where) 172 ->where($where)
  173 + ->whereOr($wheres)
171 ->paginate($total, false, ['page' => $page]) 174 ->paginate($total, false, ['page' => $page])
172 ->toArray(); 175 ->toArray();
173 $this->success('查询成功',$cancel); 176 $this->success('查询成功',$cancel);
@@ -194,15 +197,17 @@ class Business extends Base @@ -194,15 +197,17 @@ class Business extends Base
194 $page = $this->request->post('page', 1); 197 $page = $this->request->post('page', 1);
195 $total = $this->request->post('total', 10); 198 $total = $this->request->post('total', 10);
196 $where["a.verification_store_id"] = ["=", $this->store_id]; 199 $where["a.verification_store_id"] = ["=", $this->store_id];
  200 + $wheres=[];
197 if($keyfield){ 201 if($keyfield){
198 - $where['a.phone'] =['like', '%' . $keyfield . '%'];  
199 - $where['a.order_no'] = ['like', '%' . $keyfield . '%']; 202 + $wheres['a.phone'] =['like', '%' . $keyfield . '%'];
  203 + $wheres['a.order_no'] = ['like', '%' . $keyfield . '%'];
200 } 204 }
201 $field = "a.price,b.image,a.id,a.order_no,a.name,a.phone,a.type,b.title,DATE_FORMAT(FROM_UNIXTIME(a.paytime), '%Y-%m-%d %H:%i:%S') AS paytime,a.type"; 205 $field = "a.price,b.image,a.id,a.order_no,a.name,a.phone,a.type,b.title,DATE_FORMAT(FROM_UNIXTIME(a.paytime), '%Y-%m-%d %H:%i:%S') AS paytime,a.type";
202 $order=Db::name('verification_order') 206 $order=Db::name('verification_order')
203 ->alias('a') 207 ->alias('a')
204 ->join('verification_activity b','a.verification_activity_id=b.id') 208 ->join('verification_activity b','a.verification_activity_id=b.id')
205 ->where($where) 209 ->where($where)
  210 + ->whereOr($wheres)
206 ->field($field) 211 ->field($field)
207 ->paginate($total, false, ['page' => $page]) 212 ->paginate($total, false, ['page' => $page])
208 ->toArray(); 213 ->toArray();