0
讓我有這種情況迴環:嵌套關係,讓家長在查詢
型號: - 競爭 - 競爭賽季 - 比賽
在競爭季節有:
"relations": {
"matches": {
"type": "hasMany",
"model": "match",
"foreignKey": "competition-seasonId"
},
"competition": {
"type": "belongsTo",
"model": "competition",
"foreignKey": ""
}
}
並且匹配有:
"relations": {
"competition-season": {
"type": "belongsTo",
"model": "competition-season",
"foreignKey": ""
}
}
我所試圖做的是列出的比賽時,爲了獲得競爭對象,但與此
{
include: ['competition-season']
}
現在我想起來了
[
{
id: 'xxxx',
competition-seasonId: 'yyyy',
competition-season: {
competitionId: 'zzzz'
}
}
]
所以想獲得的競爭對象,不只是身份證