|
@@ -193,7 +193,7 @@ func (w *ContactWay) Save() error {
|
|
|
return true
|
|
|
})
|
|
|
} else {
|
|
|
- acwOutput := qywc.UpdateContactWay(entity.UpdateContactWayInput{Remark: w.Remark, SkipVerify: w.SkipVerify, User: w.User})
|
|
|
+ acwOutput := qywc.UpdateContactWay(entity.UpdateContactWayInput{ConfigId: w.ConfigId, Remark: w.Remark, SkipVerify: w.SkipVerify, User: w.User})
|
|
|
if acwOutput == nil || acwOutput.Errcode != 0 {
|
|
|
log.Println("ContactWay Save: 调用UpdateContactWay失败:", acwOutput)
|
|
|
return errors.New("保存失败,请稍后重试")
|
|
@@ -202,9 +202,9 @@ func (w *ContactWay) Save() error {
|
|
|
// 调用成功 开始存库
|
|
|
b = config.JysqlDB.ExecTx("更新企业微信-联系我二维码", func(tx *sql.Tx) bool {
|
|
|
// 存二维码表
|
|
|
- updateCodeSql := fmt.Sprintf("update %s set `name`=?,`skip_verify`=?,`remark`=?,`update_date`=now();", entity.WxQyCodeTable)
|
|
|
+ updateCodeSql := fmt.Sprintf("update %s set `name`=?,`skip_verify`=?,`remark`=?,`update_date`=now() where config_id=?;", entity.WxQyCodeTable)
|
|
|
values := []interface{}{
|
|
|
- w.Name, common.If(w.SkipVerify, 0, 1), w.Remark,
|
|
|
+ w.Name, common.If(w.SkipVerify, 0, 1), w.Remark, w.ConfigId,
|
|
|
}
|
|
|
_, err := config.JysqlDB.ExecBySqlByTx(tx, updateCodeSql, values...)
|
|
|
if err != nil {
|
|
@@ -240,7 +240,7 @@ func (w *ContactWay) Save() error {
|
|
|
for i := 0; i < len(w.WelcomeMsg); i++ {
|
|
|
insertWelMsg = append(insertWelMsg, w.ConfigId, w.WelcomeMsg[i]["reply_type"], w.WelcomeMsg[i]["title"], w.WelcomeMsg[i]["file"], w.WelcomeMsg[i]["desc"], w.WelcomeMsg[i]["appid"], w.WelcomeMsg[i]["page"], date.NowFormat(date.Date_Full_Layout))
|
|
|
}
|
|
|
- replyCount, _ := config.JysqlDB.InsertBatchByTx(tx, entity.WxQyReplyTable, []string{`config_id`, `reply_type`, `title`, `file`, `desc`, `appid`, `page`, `create_date`}, insertWelMsg)
|
|
|
+ replyCount, _ := config.JysqlDB.InsertBatchByTx(tx, entity.WxQyReplyTable, []string{`config_id`, `reply_type`, `title`, `file`, "`desc`", `appid`, `page`, `create_date`}, insertWelMsg)
|
|
|
if replyCount < 0 {
|
|
|
log.Println("ContactWay Save: 数据库wx_qy_reply 保存失败", w.ConfigId, insertUserList)
|
|
|
return false
|