From ccfd85f7e410f506e5cd42eddfc61bd6955def52 Mon Sep 17 00:00:00 2001 From: zengchaoxin Date: Wed, 23 Oct 2019 15:06:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BF=9D=E5=8D=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9D=A1=E4=BB=B6=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/controllers/InsurerController.php | 34 ++++++++-------------- frontend/views/insurer/search.php | 23 +++++++++++---- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/frontend/controllers/InsurerController.php b/frontend/controllers/InsurerController.php index a0e865e..dddef3c 100644 --- a/frontend/controllers/InsurerController.php +++ b/frontend/controllers/InsurerController.php @@ -3673,30 +3673,19 @@ class InsurerController extends BaseController $id_man = $request->get('id_man'); $phone = $request->get('phone'); $car_no = $request->get('car_no'); - $page = $request->get('page',1); $date_begin = $request->get('date_begin'); $date_end = $request->get('date_end'); $date2_begin = $request->get('date2_begin'); $date2_end = $request->get('date2_end'); $date3_begin = $request->get('date3_begin'); $date3_end = $request->get('date3_end'); - $group_id = $request->get('group_id'); - $company_id = $request->get('company_id'); - $insurance_status= $request->get('insurance_status'); + $status = $request->get('status'); $offset = $request->get('offset',0); $limit = $request->get('limit', 10); - $group_items = GroupT::getTree(); - $group_ids[] = $group_id; - if($group_id > 0) { - $items = GroupT::getTree($group_id); - foreach($items as $group_info) { - $group_ids[] = $group_info->id; - } - } $query = OrderT::find() ->where('status_id>1') - ->orderBy('car_no desc,submit_date asc'); + ->orderBy('car_no desc,submit_date asc'); if($id_man != '') { $query->andWhere(['like','id_man',$id_man]); } @@ -3704,7 +3693,7 @@ class InsurerController extends BaseController $query->andWhere(['like','car_man',$car_man]); } if($phone != '') { - $query->andWhere(['like','link_phone',$phone]); + $query->andWhere('car_man_phone like :phone or id_man_phone like :phone or link_man_phone like :phone', [':phone'=>$phone]); } if($car_no != '') { $query->andWhere(['like','car_no',$car_no]); @@ -3722,17 +3711,18 @@ class InsurerController extends BaseController $query->andWhere('print_date<="'.$date2_end.'"'); } if($date3_begin != '') { - $query->andWhere('insurer1_begin_date>="'.$date3_begin.'"'); + $query->andWhere('insurer1_begin_date>=:begin_date or insurer2_begin_date>=:begin_date', [':begin_date'=>$date3_begin]); } if($date3_end != '') { - $query->andWhere('insurer1_begin_date<="'.$date3_end.'"'); - } - - if($company_id != '') { - $query->andWhere('company_id ="'.$company_id.'"'); + $query->andWhere('insurer1_begin_date<=:end_date or insurer2_begin_date<=:end_date', [':end_date'=>$date3_end]); } - if($insurance_status != '') { - $query->andWhere('insurance_status ="'.$insurance_status.'"'); + if($status > 0) { + if($status == 1) { + $query->andWhere('status>1 and status<10'); + } + if($status == 2) { + $query->andWhere('status=10'); + } } $total = $query->count(); diff --git a/frontend/views/insurer/search.php b/frontend/views/insurer/search.php index 0d69d7a..7317720 100644 --- a/frontend/views/insurer/search.php +++ b/frontend/views/insurer/search.php @@ -16,7 +16,7 @@ use \common\libs\MyLib;
-
+
+ + +
@@ -92,6 +100,7 @@ use \common\libs\MyLib;