A库筛选保险日期调试

webUi^2
zhaocheng 5 years ago
parent 31e044f955
commit 4b4307fbe4
  1. 16
      frontend/controllers/DatabaseController.php

@ -108,18 +108,6 @@ class DatabaseController extends BaseController
$biaozhu = $request->get('biaozhu'); $biaozhu = $request->get('biaozhu');
$car_use_id = $request->get('car_use_id'); $car_use_id = $request->get('car_use_id');
} }
$insurer1_begin_arr = explode('-',$insurer1_begin);
if(count($insurer1_begin_arr) == 2){
$insurer1_begin = '';
$insurer1_month = $insurer1_begin_arr[0];
$insurer1_day = $insurer1_begin_arr[1];
}
$insurer1_end_arr = explode('-',$insurer1_end);
if(count($insurer1_end_arr) == 2){
$insurer1_end = '';
$insurer1_month1 = $insurer1_end_arr[0];
$insurer1_day1 = $insurer1_end_arr[1];
}
$params = array(); $params = array();
$params['car_man'] = $car_man; $params['car_man'] = $car_man;
$params['phone'] = $phone; $params['phone'] = $phone;
@ -194,10 +182,10 @@ class DatabaseController extends BaseController
$query->andWhere('register_date<="'.$register_end.'"'); $query->andWhere('register_date<="'.$register_end.'"');
} }
if($insurer1_begin != '') { if($insurer1_begin != '') {
$query->andWhere('insurer1_date>="'.$insurer1_begin.'"'); $query->andWhere('date_format(insurer1_date,\'%mm-%dd\')>="'.$insurer1_begin.'"');
} }
if($insurer1_end != '') { if($insurer1_end != '') {
$query->andWhere('insurer1_date<="'.$insurer1_end.'"'); $query->andWhere('date_format(insurer1_date,\'%mm-%dd\')<="'.$insurer1_end.'"');
} }
if($insurer1_month != '') { if($insurer1_month != '') {
$query->andWhere('month(car_t.insurer1_date)>="'.$insurer1_month.'"'); $query->andWhere('month(car_t.insurer1_date)>="'.$insurer1_month.'"');

Loading…
Cancel
Save