From c292fe4d3330eb098b376f8d07aa3915d2259faf Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Tue, 29 Jul 2025 17:36:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E9=A2=98=E5=BA=93?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E9=87=8D=E5=A4=8D=E7=9A=84=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E9=80=BB=E8=BE=9114?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/service/QuestionQa.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) 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"] = "" } // 背景图