0
我已经从用户表中创建了两个外键。续集多个外键仅包含一列
`db.Subscription.belongsTo(db.User, {foreignKey: 'creatorId'});
db.Subscription.belongsTo(db.User, {foreignKey: 'subscriberId'});`
搜索查询过程中出现了包括代替creatorId
Subscription.findAll({ where: { subscriberId: req.decoded._id
subscriberId
列在这里输入 }, include: [ {model: User, foreignKey: 'creatorId', attributes: ['name', 'role', 'uid', 'imageUrl']}] })
代码有人可以找出我在做什么错在这里。
非常感谢迪兰它的工作。 :) –