完善保单查询条件搜索

dev
曾超新 5 years ago
parent ae26fc5310
commit ccfd85f7e4
  1. 34
      frontend/controllers/InsurerController.php
  2. 23
      frontend/views/insurer/search.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();

@ -16,7 +16,7 @@ use \common\libs\MyLib;
</div>
</div>
<div class="ibox-content">
<form role="form" id="search" class="form-inline" onsubmit="return search();">
<form role="form" id="searchFrm" class="form-inline" onsubmit="return search();">
<div class="form-group" style="margin-bottom: 8px;">
<label for="username">车主</label>
<input type="text" id="car_man" name="car_man" class="form-control">
@ -57,6 +57,14 @@ use \common\libs\MyLib;
<input type="text" class="form-control" id="date3_end" name="date3_end" autocomplete="off" />
</div>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="car_no">状态</label>
<select name="status" id="status" class="form-control">
<option value="0">全部</option>
<option value="1">未完成</option>
<option value="2">已完成</option>
</select>
</div>
<button type="submit" class="btn btn-primary">搜索</button>
</form>
<div class="row">
@ -92,6 +100,7 @@ use \common\libs\MyLib;
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script>
var o = {};
function opFormatter(value, row, index) {
var opStr = [];
opStr.push('<a href="javascript:void(0);" onclick="info(' + row.id + ')">');
@ -110,16 +119,20 @@ use \common\libs\MyLib;
}
function search() {
o = {};
var params = $("#searchFrm").serializeArray();
$.each(params, function(index) {
o[this['name']] = this['value'];
});
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/insurer/search-json",
pagination: true,
sidePagination: 'server',
queryParams: function(params) {
$('#search').find(':input:not(input[type=button],input[type=submit],button)').each(function(index,item){
params[$(item).attr('name')] = $(item).val();
});
return params;
o['limit'] = params['limit'];
o['offset'] = params['offset'];
return o;
}
});
return false;

Loading…
Cancel
Save