0
它是否能夠實現從兩個表如何從兩個表中使用REST請求
得到結構響應程序的功能,我有兩個表獲得結構化JSON包含公司和電話包含每家公司的電話號碼。 一家公司 - >通過companyID
相關的許多手機我需要的正是這種結構:
{
"resource": [
{
"companyId": 1,
"companyName": "Apple",
"companySubject": "Security",
"phones": [
{
"name": "tel1",
"phone": "+178548555"
}
]
},
{
"companyId": 2,
"companyName": "Samsung",
"companySubject": "IT",
"phones": [
{
"name": "tel1",
"phone": "+178548555"
},
{
"name": "tel2",
"phone": "+178548555"
},
{
"name": "tel3",
"phone": "+178548555"
}
]
},
{
"companyId": 3,
"companyName": "LG",
"companySubject": "Accounting",
"phones": [
{
"name": "tel1",
"phone": "+178548555"
},
{
"name": "tel2",
"phone": "+178548555"
}
]
}
]
}
問題是,他們在不同的表,我無法弄清楚如何實現它。
我用dreamfactory爲後端