nodejs爬坑记录

2018-05-26  本文已影响91人  Vijay_

nodejs爬坑记录

Sequelize

commit has been called on this transaction(a0989c57-6b52-4093-87a7-02d5ca7e4b08), you can no longer use it. (The rejected query is attached as the 'sql' property of this error)
const teamModels = await UserTeamRelation.findAll({
    where: { leaderId: userId },
//include代表在原先的字段基础上再加一个字段,exclude表示排除某个字段
    attributes: {include:[[Sequelize.fn("SUM", Sequelize.col("userIntegral.integral")), "userIntegral.integral"]]},
    include: [{  model: UserIntegralModule, where: { userId }, as: "userIntegral" }
      , { model: User, as: "member" }]
  });
上一篇下一篇

猜你喜欢

热点阅读