我有两个表tblOne和tblTwo。 tblOne表包含类似
的值**Id Amount TotalReceipt**
1 1000 2
2 2000 3
tblTwo表包含类似
的值**Id tblOneId ReceiptNo**
1 1 001
2 1 002
3 2 003
4 2 004
5 2 005
有什么方法可以获取以下json格式的结果:
{
{
"Id":"1",
"Amount":"1000",
"TotalReceipt":"2",
"ReceiptDetail":[
{"Id":"1","tblOneId":"1","ReceiptNo":"001"},
{"Id":"2","tblOneId":"1","ReceiptNo":"002"}
]
},
{
"Id":"2",
"Amount":"2000",
"TotalReceipt":"3",
"ReceiptDetail":[
{"Id":"3","tblOneId":"2","ReceiptNo":"003"},
{"Id":"4","tblOneId":"2","ReceiptNo":"004"},
{"Id":"5","tblOneId":"2","ReceiptNo":"005"}
]
}
}