productsModel.findAndCountAll({
offset: size * (no - 1),
limit: size,
order: [
['updatedAt', 'DESC']
],
where: {
[Op.or]: [
{
brand: {
[Op.like]: `%${keyword}%`
}
},
sequelize.where(
sequelize.cast(sequelize.col('products.price'), 'char'),
{
[Op.like]: `%${keyword}%`
}
),
]
}
})
使用sequelize对数字进行模糊查询
猜你喜欢
转载自blog.csdn.net/juzipidemimi/article/details/88825666
今日推荐
周排行