我有一个看起来像这样的数组:
[
{
"id": "1",
"country_id": "1",
"spec_id": "1",
"spec_children_name": "SUPER REDUCES RATE",
"spec_children_first_col": "",
"spec_children_second_col": "",
"spec_children_third_col": ""
},
{
"id": "2",
"country_id": "1",
"spec_id": "1",
"spec_children_name": "REDUCED RATE",
"spec_children_first_col": "10% and 13%",
"spec_children_second_col": "food, passenger transport, accommodotion, newspaper, pharmaceutical products,\u2026.(10%); plants, antiques, firewood, cinema, theatre,\u2026(13%)",
"spec_children_third_col": ""
},
{
"id": "3",
"country_id": "1",
"spec_id": "1",
"spec_children_name": "MEDIUM RATE",
"spec_children_first_col": "",
"spec_children_second_col": "",
"spec_children_third_col": ""
},
{
"id": "4",
"country_id": "1",
"spec_id": "1",
"spec_children_name": "STANDARD RATE",
"spec_children_first_col": "20%",
"spec_children_second_col": "other",
"spec_children_third_col": ""
},
{
"id": "5",
"country_id": "1",
"spec_id": "1",
"spec_children_name": "ZERO RATE",
"spec_children_first_col": "",
"spec_children_second_col": "",
"spec_children_third_col": ""
},
{
"id": "104",
"country_id": "2",
"spec_id": "1",
"spec_children_name": "REDUCED RATE",
"spec_children_first_col": "TEXT 547",
"spec_children_second_col": "TEXT 1000",
"spec_children_third_col": ""
}
]
我想要什么:我想按2个对象键比较对此数组进行排序,如果和.最后,它应该看起来像这样:spec_children_namespec_id
[
[
{
"id": "1",
"country_id": "1",
"spec_id": "1",
"spec_children_name": "SUPER REDUCES RATE",
"spec_children_first_col": "",
"spec_children_second_col": "",
"spec_children_third_col": ""
},
小唯快跑啊
拉风的咖菲猫
慕村9548890