您的位置:首页 > 其它

购物车多店铺列表数组处理

2016-03-17 10:58 274 查看
/**
* 在取出了所有购物车对应的商品信息后,按照店铺id对其进行分组
*/
$store_group = array();
foreach ($goods_info as $item){
$store_group[$item['store_id']][]=$item;
}
$toreM=M('Store');
foreach($store_group as $store_id=>&$item){
$storeInfo=$toreM->field('id as store_id, store_name,store_logo')->where(array('id'=>$store_id))->find();
$item=array_merge($storeInfo,array('goods_list'=>$item));
}
$store_group=array_values($store_group);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: