修复更新

This commit is contained in:
aixianling
2022-05-20 14:04:13 +08:00
parent a68b911d39
commit 585e6deb89

View File

@@ -4,7 +4,7 @@ const addOrUpdate = form => {
return dbUtils.query(`select 1 from node_wechat_apps where id='${form.id}'`).then(res => {
if (res.length > 0) {//编辑
let arr = Object.keys(form).filter(e => form[e]).map(e => `${e}='${form[e]}'`)
return `update node_wechat_apps set ${arr.join(",")} where id='${form.name}'`
return `update node_wechat_apps set ${arr.join(",")} where id='${form.name}' and type='${form.type}'`
} else {//新增
let cols = [], arr = []
Object.keys(form).map(e => {