foreach ($list as $k=> $teamGoods){ if($teamGoods['status'] > 4){ $_soldGoods[] = $teamGoods; unset($list[$k]); } } $list = array_merge($list, $_soldGoods);
当没有状态为4的商品的时候合并数据 导致$list 为空
以后还是先确定合并的参数为数组把。。 若类型果然坑人- -
解决:
$_soldGoods = array(); foreach ($list as $k=> $teamGoods){ if($teamGoods['status'] > 4){ $_soldGoods[] = $teamGoods; unset($list[$k]); } } $list = array_merge($list, $_soldGoods);