diff --git a/api/service/QuestionQa.go b/api/service/QuestionQa.go index 7310268..0dd85e8 100644 --- a/api/service/QuestionQa.go +++ b/api/service/QuestionQa.go @@ -378,18 +378,20 @@ func (r *QuestionQaService) PutQuestionQa(qaId int64, req requests.PutQuestionQa } // 是否允许重复 - if len(req.RepeatQaId) > 0 { - var repeatQaId []string - for _, item := range req.RepeatQaId { - repeatQaId = append(repeatQaId, item.QaId) - } + if req.Action == 2 { + if len(req.RepeatQaId) > 0 { + var repeatQaId []string + for _, item := range req.RepeatQaId { + repeatQaId = append(repeatQaId, item.QaId) + } - repeatQaIdStr := strings.Join(repeatQaId, ",") - if repeatQaIdStr != questionQa.RepeatQaId { - questionQaData["repeat_qa_id"] = repeatQaIdStr + repeatQaIdStr := strings.Join(repeatQaId, ",") + if repeatQaIdStr != questionQa.RepeatQaId { + questionQaData["repeat_qa_id"] = repeatQaIdStr + } + } else { + questionQaData["repeat_qa_id"] = "" } - } else { - questionQaData["repeat_qa_id"] = "" } // 背景图