背景:
const EventUser = sequelize.define('userEvents', { payStatus: Sequelize.STRING }) User.belongsToMany(Event, { through: EventUser}) Event.belongsToMany(User, { through: EventUser})
使用:
const event = await EventModel.getEventDetail(eventId); const user = await UserModel.findUserById(userId); //这里event和user都是有值的,确认 try { await event.addUser(user, { through: { payStatus: payStatus }}) //这里报错 } catch (e) { console.log(e) }
30秒到达战场
拉莫斯之舞
相关分类