作者 jinglong
1 个管道 的构建 通过 耗费 1 秒

修改结算优惠券

... ... @@ -534,13 +534,13 @@ class Cars extends Api
$r_value['use_goods_id'] = $goods_id_s;
}else if($r_value['type_tag'] == $type[1]){
//品牌
$r_value['use_goods_id'] = [];
$arr = [];
foreach($res1 as $value1){
if($r_value['bg_id'] == $value1['t_id']){
$r_value['use_goods_id'] = [$value1['id']];
array_push($arr,$value1['id']);
}
}
$r_value['use_goods_str'] = implode(',',$r_value['use_goods_id']);
$r_value['use_goods_id'] = $arr;
}else{
//商品
$r_value['use_goods_id'] = [];
... ... @@ -553,6 +553,7 @@ class Cars extends Api
}
}
$res2 = [];
//满减金额的优惠券
foreach($res as $res_value){
$res2_flag = 0;
if($res_value['c_type'] == 1){
... ... @@ -562,8 +563,22 @@ class Cars extends Api
if(($total_goods_price <=> $res_value['full_reduce']) == -1){
$res2_flag = 1;
}
}else if($res_value['type_tag'] == $type[1]){
//品牌
$price = 0;
foreach($res_goods as $goods_value){
foreach($res_value['use_goods_id'] as $u_value){
//品牌下的商品id
if($u_value == $goods_value['goods_id']){
$price += $goods_value['price'];
}
}
}
if(($price <=> $res_value['full_reduce']) == -1){
$res2_flag = 1;
}
}else{
//品牌,商品
//商品
$price = 0;
foreach($res_goods as $goods_value){
if($res_value['use_goods_str'] == $goods_value['goods_id']){
... ...