作者:文女2010_532 | 来源:互联网 | 2023-10-12 15:15
网上找不到相关资料,只有一个调用mysql函数的方法,但是写的也很模糊
1 2 3 4 5 6 7 8 9
| var dailyView = yield DailyViewModel.findAll({
where:{$and:[
sequelize.where(sequelize.fn('TO_DAYS', sequelize.col('dailyview.stateDate')),'>=',sequelize.fn('TO_DAYS',lastDate)),
sequelize.where(sequelize.fn('TO_DAYS', sequelize.col('dailyview.stateDate')),'<=',sequelize.fn('TO_DAYS',now))
]},
order:[["stateDate","DESC"]]
});
比如有存储过程p1(IN id int,OUT count id) |
sequelize该如何写一个js函数来执行它呢?