其实都是mysql语句的操作,就可以
删除一条或者多条数据
用到的语句
sql = DELETE FROM t_leave_info WHERE leave_info_id IN (640,634,633);
实例
removeId (sort, arr) {
// console.log(arr.join()arr.join())
let str = arr.join()
let delesql = 'delete from '+sort+' where id in ('+str+')'
// console.log(delesql)
return new Promise((resolve,reject) => {
pool.query(delesql, (err, res) => {
if(err) {
throw err
}
resolve(res)
})
})
参考:
https://codeday.me/bug/20171012/83136.html
https://www.jianshu.com/p/ebcba9d9a7ed