这是我想要根据年份值组合的数组
0 => array:3 [▼ "year" => 2022 "total_policies_financed" => 1 "total_amount_financed" => 280.0 ] 1 => array:3 [▼ "year" => 2022 "total_policies_financed" => 2 "total_amount_financed" => 5190.0 ] 2 => array:3 [▼ "year" => 2021 "total_policies_financed" => 2 "total_amount_financed" => 5190.0 ]
需要这样的输出
0 => array:3 [▼ "year" => 2022, "total_count" => 2, "total_policies_financed" => 3 "total_amount_financed" => 5470 ] 1 => array:3 [▼ "year" => 2021, "total_count" => 1, "total_policies_financed" => 2 "total_amount_financed" => 5190.0 ]
试试这个: