Sequelize 踩坑记录
2019/03/07
  • include order 无效

错误:

include: [
          {
            model:ctx.model.OrderReturn,
            order:[['createdAt','DESC']]
          },
        ],
        ```

正确:

include: [
          {
            model:ctx.model.OrderReturn
          },
        ],
        order: [ [ { model: ctx.model.OrderReturn}, 'createdAt','DESC'] 
        ]
        ```