【发布时间】:2018-10-30 19:37:56
【问题描述】:
我需要有关如何按位置和大小对以下集合进行分组的帮助:
[
{
"location_id": 1,
"location_address": "Some address",
"location_image": "https://some/image.url",
"size_id": 1,
"size_code": "S",
"available_boxes": 3
},
{
"location_id": 1,
"location_address": "Some address",
"location_image": "https://some/image.url",
"size_id": 2,
"size_code": "M",
"available_boxes": 4
},
{
"location_id": 1,
"location_address": "Some address",
"location_image": "https://some/image.url",
"size_id": 3,
"size_code": "L",
"available_boxes": 5
},
{
"location_id": 2,
"location_address": "Some other address",
"location_image": "https://some/other/image.url",
"size_id": 4,
"size_code": "XL",
"available_boxes": 10
}
]
这是预期的结果:
真的很感激,提前谢谢!
【问题讨论】:
-
你试过写什么吗?
-
其他用户将您的问题标记为低质量和需要改进。我重新措辞/格式化您的输入,使其更易于阅读/理解。请查看我的更改以确保它们反映您的意图。但我认为你的问题仍然无法回答。 你现在应该edit你的问题,包括你自己的努力(见help me is not a question)。如果您对我有其他问题或反馈,请随时给我留言。
-
@GhostCat,感谢您的帮助!
标签: php collections laravel-5.5