【发布时间】:2017-08-30 04:10:09
【问题描述】:
所以我有这个场景
型号: - 竞赛 - 比赛赛季 - 匹配
比赛赛季在哪里:
"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'
}
}
]
所以想得到比赛对象,而不仅仅是id
【问题讨论】: