[
{
"status": true,
"data": [
{
"id": 2,
"name": "Algeria",
"country_code": "DZ",
"regions": [
{
"id": 2,
"country_id": 2,
"region_code": "RG01",
"depots": [
{
"id": 5,
"region_id": 2,
"depot_code": "DP04",
"depot_name": "North Depot",
"area": [
{
"id": 1,
"depot_id": 5,
"area_code": "AR1",
"area_name": "Area-1"
},
{
"id": 2,
"depot_id": 5,
"area_code": "AR2",
"area_name": "Area-2"
}
]
},
{
"id": 6,
"region_id": 2,
"depot_code": "DP06",
"depot_name": "east Depot",
"area": [
{
"id": 3,
"depot_id": 6,
"area_code": "AR3",
"area_name": "Area-3"
}
]
}
]
},
{
"id": 3,
"country_id": 2,
"region_code": "RG02",
"depots": []
}
]
}
]
}
]
我想将区域合并到单个数组中
"area": [
{
"id": 1,
"depot_id": 5,
"area_code": "AR1",
"area_name": "Area-1"
},
我不想使用多个 foreach。提前致谢。
qq_笑_17
元芳怎么了