提交 0e805a11 authored 作者: chengye's avatar chengye

账单按照站名批量查询

上级 7ed87f15
...@@ -44,14 +44,16 @@ class Invoice extends Base ...@@ -44,14 +44,16 @@ class Invoice extends Base
$this->assign('search_text',$search_text); $this->assign('search_text',$search_text);
$searchArr = explode(',',$search_text); $searchArr = explode(',',$search_text);
$where = '';
if(count($searchArr) > 1){ if(count($searchArr) > 1){
foreach ($searchArr as $v){ foreach ($searchArr as $v){
$v = '%'.$v.'%'; $v = '%'.$v.'%';
$map[]=['station.station_name','like',"$v"]; $where .= ['station.station_name','like',"$v"] .' or ';
} }
} else { } else {
$map[]=['station.station_name','like',"%$search_text%"]; $where = ['station.station_name','like',"%$search_text%"];
} }
$map[] = rtrim($where,' or ');
$this->assign('search_type',$search_type); $this->assign('search_type',$search_type);
break; break;
case '3': case '3':
...@@ -64,7 +66,6 @@ class Invoice extends Base ...@@ -64,7 +66,6 @@ class Invoice extends Base
$this->assign('search_type',''); $this->assign('search_type','');
$this->assign('search_text',''); $this->assign('search_text','');
} }
dd($map);
//抄表时间查询条件 //抄表时间查询条件
$dateStart = strtotime(Request::get('date_start')); $dateStart = strtotime(Request::get('date_start'));
$dateEnd = strtotime(Request::get('date_end')); $dateEnd = strtotime(Request::get('date_end'));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论