Parcourir la source

新增路演问答

317699326@qq.com il y a 1 mois
Parent
commit
02cf859fbb
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  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 {