|
|
@ -521,48 +521,60 @@ class MarketingStrategyController extends UserBaseController |
|
|
|
->andWhere(['<=','baofei', $total1_clear]) |
|
|
|
->andWhere(['<=','baofei', $total1_clear]) |
|
|
|
->all(); |
|
|
|
->all(); |
|
|
|
$ids = []; |
|
|
|
$ids = []; |
|
|
|
|
|
|
|
$flags = []; |
|
|
|
foreach($items as $item) { |
|
|
|
foreach($items as $item) { |
|
|
|
$flag = false; |
|
|
|
|
|
|
|
//车牌 |
|
|
|
//车牌 |
|
|
|
|
|
|
|
$flags[0] = 0; |
|
|
|
if($item->car_type_id != '') { |
|
|
|
if($item->car_type_id != '') { |
|
|
|
$car_type_ids = explode(',',$item->car_type_id); |
|
|
|
$car_type_ids = explode(',',$item->car_type_id); |
|
|
|
$tmp_type_id = 1; |
|
|
|
$tmp_type_id = 1; |
|
|
|
if(mb_substr($car_no, 0, 1, 'utf-8') != '京') |
|
|
|
if(mb_substr($car_no, 0, 1, 'utf-8') != '京') |
|
|
|
$tmp_type_id = 2; |
|
|
|
$tmp_type_id = 2; |
|
|
|
if(in_array($tmp_type_id, $car_type_ids)) { |
|
|
|
if(in_array($tmp_type_id, $car_type_ids)) { |
|
|
|
$flag = true; |
|
|
|
$flags[0] = 1; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$flag = false; |
|
|
|
$flags[0] = -1; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//保险公司 |
|
|
|
//保险公司 |
|
|
|
|
|
|
|
$flags[1] = 0; |
|
|
|
if($item->company_ids != '') { |
|
|
|
if($item->company_ids != '') { |
|
|
|
$company_ids = explode(',',$item->company_ids); |
|
|
|
$company_ids = explode(',',$item->company_ids); |
|
|
|
if(in_array($company2_id, $company_ids)) { |
|
|
|
if(in_array($company2_id, $company_ids)) { |
|
|
|
$flag = true; |
|
|
|
$flags[1] = 1; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$flag = false; |
|
|
|
$flags[1] = -1; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//车辆使用类型 |
|
|
|
//车辆使用类型 |
|
|
|
|
|
|
|
$flags[2] = 0; |
|
|
|
if($item->car_use_id != '') { |
|
|
|
if($item->car_use_id != '') { |
|
|
|
$car_use_ids = explode(',',$item->car_use_id); |
|
|
|
$car_use_ids = explode(',',$item->car_use_id); |
|
|
|
if(in_array($car_use_id, $car_use_ids)) { |
|
|
|
if(in_array($car_use_id, $car_use_ids)) { |
|
|
|
$flag = true; |
|
|
|
$flags[2] = 1; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$flag = false; |
|
|
|
$flags[2] = -1; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//新保、续保 |
|
|
|
//新保、续保 |
|
|
|
|
|
|
|
$flags[3] = 0; |
|
|
|
if($item->type_ids != '') { |
|
|
|
if($item->type_ids != '') { |
|
|
|
$type_ids = explode(',',$item->type_ids); |
|
|
|
$type_ids = explode(',',$item->type_ids); |
|
|
|
$tmp_type_id = 1; |
|
|
|
$tmp_type_id = 1; |
|
|
|
if($car_info->is_xubao > 0) |
|
|
|
if($car_info->is_xubao > 0) |
|
|
|
$tmp_type_id = 2; |
|
|
|
$tmp_type_id = 2; |
|
|
|
if(in_array($tmp_type_id, $type_ids)) { |
|
|
|
if(in_array($tmp_type_id, $type_ids)) { |
|
|
|
$flag = true; |
|
|
|
$flags[3] = 1; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
$flags[3] = -1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$flag = true; |
|
|
|
|
|
|
|
foreach($flags as $tmp_flag) { |
|
|
|
|
|
|
|
if($tmp_flag == 0) continue; |
|
|
|
|
|
|
|
if($tmp_flag == -1) { |
|
|
|
$flag = false; |
|
|
|
$flag = false; |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if($flag) { |
|
|
|
if($flag) { |
|
|
|