diff --git a/src/rest/wechatapps/add.js b/src/rest/wechatapps/add.js index d9a4b0c..dc89e29 100644 --- a/src/rest/wechatapps/add.js +++ b/src/rest/wechatapps/add.js @@ -1,7 +1,7 @@ const dbUtils = require("../../utils/dbUitls"); const addOrUpdate = form => { - return dbUtils.query(`select 1 from node_wechat_apps where id=${form.id}`).then(res => { + 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}'` @@ -13,7 +13,7 @@ const addOrUpdate = form => { arr.push(`'${form[e]}'`) } }) - return `insert into node_wechat_apps (id,${cols.join(",")}) values('${form.name}',${arr.join(",")})` + return `insert into node_wechat_apps (${cols.join(",")}) values(${arr.join(",")})` } })