修改策略判断条件

dev
曾超新 5 years ago
parent 9df4895062
commit 2966d222ea
  1. 28
      frontend/controllers/MarketingStrategyController.php

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

Loading…
Cancel
Save