如何优化这种数据结构,用于存入到数据库中
原始数据结构
[
[
"group"=>"A",
"list"=>[
["name"=>"1"],
["name"=>"2"],
["name"=>"3"],
]
],
[
"group"=>"B"
"list"=>[
["name"=>"4"],
["name"=>"5"],
["name"=>"6"],
]
]
]
转化后的数据结构
[
["group"=>"A","name"=>"1"],
["group"=>"A","name"=>"2"],
["group"=>"A","name"=>"3"],
["group"=>"B","name"=>"4"],
["group"=>"B","name"=>"5"],
["group"=>"B","name"=>"6"],
]