/**
* 在取出了所有购物车对应的商品信息后,按照店铺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);
购物车多店铺列表数组处理
最新推荐文章于 2021-08-15 08:54:35 发布