this.User.findAll({
attributes: ['id', [sequelize.literal("firstname ||
' ' || lastname "),"
fullName "],"
fullName "],where: {
fullName: {
[Op.like]: '%' searchData "%"
}
}
})
//SQLITE_ERROR:沒有這樣的列:fullName
uj5u.com熱心網友回復:
使用相同的文字Sequelize.where來實作您的目標:
this.User.findAll({
attributes: ['id', [sequelize.literal("firstname ||
' ' || lastname "),"
fullName "],"
fullName "],
where: Sequelize.where(sequelize.literal("firstname ||
' ' || lastname "), Op.like, '%' searchData '%')
})
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/463251.html
