瀏覽代碼

新增路演问答

317699326@qq.com 1 月之前
父節點
當前提交
02cf859fbb
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      models/roadshow/calendar_researcher_question.go

+ 8 - 0
models/roadshow/calendar_researcher_question.go

@@ -35,6 +35,14 @@ func RoadShowQuestionSave(req *RoadShowQuestionSaveReq) (err error) {
 		return err
 	}
 
+	defer func() {
+		if err != nil {
+			tx.Rollback()
+		} else {
+			tx.Commit()
+		}
+	}()
+
 	sql := ` UPDATE rs_calendar_researcher SET company_industry = ?,company_classify = ?,question_status=1 WHERE rs_calendar_researcher_id = ? `
 	_, err = tx.Raw(sql, req.CompanyIndustry, req.CompanyClassify, req.RsCalendarResearcherId).Exec()
 	if err != nil {