php计算优惠信息 求计算算法 谢谢
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->$arr=array('item_info_list' => Array
(
'0' => Array
(
'sku_id' => '1003244250',
'ware_id' => '1001418658',
'jd_price' => '269.00',
'sku_name' => '百事PEPSI 男式板鞋 2012新款夏季透气舒适男款经典休闲板鞋 猎人绿 40',
'outer_sku_id' => '40872121106',
'product_no' => '872121101 872121102 872121104 872121105',
'gift_point' => '0',
'item_total' => '1',
)
,
'1' => Array
(
'sku_id' => '1003244255',
'ware_id' => '1001418658',
'jd_price' => '269.00',
'sku_name' => '百事PEPSI 男式板鞋 2012新款夏季透气舒适男款经典休闲板鞋 暗红 39',
'outer_sku_id' => '39872121105',
'product_no' => '872121101 872121102 872121104 872121105',
'gift_point' => '0',
'item_total' => '1',
)
)
,
'coupon_detail_list' => Array
(
'0' => Array
(
'order_id' => '213978711',
'sku_id' => '1003244250',
'coupon_type' => '30-单品促销优惠',
'coupon_price' => '170.00',
)
,
'1' => Array
(
'order_id' => '213978711',
'sku_id' => '1003244255',
'coupon_type' => '30-单品促销优惠',
'coupon_price' => '170.00',
)
)
)
foreach ($arr['item_info_list'] as $key=>$val)
{
if(isset($arr['coupon_detail_list'][$key]))
$arr['item_info_list'][$key] = array_merge($val, $arr['coupon_detail_list'][$key]);
}
print_r($arr);
<div class="clear"></div>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号