这是我的代码: - 在sequelize如何订购急切加载。 按订单字段
.findAll({
include: [{
model: db.tab,
include: [{
model: db.column,
include: [{
model: db.tabelement
}]
}, {
model: db.tabbrand
}]
}],
order: [
[db.Sequelize.col('order'), 'ASC'],
[db.tab, db.column, db.tabelement, 'order', 'ASC']
]
})
答案 0 :(得分:0)
return db.menu
.findAll({
include: [{
model: db.tab,
include: [{
model: db.column,
include: [{
model: db.tabelement
}]
}, {
model: db.tabbrand
}]
}],
order: [
[db.Sequelize.col('order'), 'ASC'],
[db.tab, 'order', 'ASC'],
[db.tab, db.column, 'order', 'ASC'],
[db.tab, db.column, db.tabelement, 'order', 'ASC']
]
})