$voucherTypeInfo = SupplierIcbclifeLogic::getVoucherTypeInfon($voucherTypeId);
foreach ($voucherTypeInfo as $k => $v) {
$brandArr[] = $v['brand_id'];
$tempVoucher[$v['id']] = $v;
}
foreach($voucherInfo as $key=>$vo){
$list[] = array_merge($vo,$tempVoucher[$vo['voucher_id']]);
}
//查询icbc_life_brand_icon 获取icon
$brandIconList = SupplierIcbclifeLogic::getIcbcBrandIcon($brandArr);
foreach ($brandIconList as $item) {
$iconArr[$item['brand_id']] = $item['icon'];
}
foreach ($list as $voucher){
$temp['id'] = $voucher['voucher_id'];
$temp['title'] = $voucher['title'];
$price = !empty($voucher['final_fee']) ? $voucher['final_fee'] : $voucher['price'];
$temp['price'] = $price;
$temp['jifen'] = ceil(bcdiv(bcmul($price,10000),15,2));
$temp['is_show'] = $voucher['is_show'];
$temp['icon'] = isset($iconArr[$voucher['brand_id']]) ? $iconArr[$voucher['brand_id']] : 'https://www.baidu.com/img/bd_logo1.png';
$data[$voucher['name']][] = $temp;
}
return $data;
多个数组的合并
最新推荐文章于 2022-12-03 12:44:18 发布