/** * [errArrayCount 合并一个二维数组相同项,数量则相加] * @param [type] $all_date [array] * @return [type] [array] */ public function errArrayCount($all_date){ $item=array(); foreach($all_date as $k=>$v){ if(!isset($item[$v['user_id']])){ $item[$v['user_id']]=$v; }else{ $item[$v['user_id']]['paperslip']+=$v['paperslip']; $item[$v['user_id']]['growth']+=$v['growth']; } } return $item; }