From 1dbc3a81e9122cfc3f89ba60bd22e497d65c38d8 Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Sun, 29 Mar 2026 03:19:15 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=80=81=E7=89=88=E6=9C=AC=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=AB=AF=E5=8E=BB=E6=8E=89=E6=AF=8F=E4=B8=AA=E5=A5=97?= =?UTF-8?q?=E9=A4=90=20discount=20=E6=9C=80=E5=90=8E=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=EF=BC=8C=E8=80=8C=E9=9D=9E=E6=95=B4=E4=B8=AA=E5=A5=97=E9=A4=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logic/public/subscribe/querySubscribeListLogic.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/logic/public/subscribe/querySubscribeListLogic.go b/internal/logic/public/subscribe/querySubscribeListLogic.go index 4cdbed6..f2c80cf 100644 --- a/internal/logic/public/subscribe/querySubscribeListLogic.go +++ b/internal/logic/public/subscribe/querySubscribeListLogic.go @@ -59,10 +59,14 @@ func (l *QuerySubscribeListLogic) QuerySubscribeList(req *types.QuerySubscribeLi list[i] = sub } - // 老版本客户端(无 X-App-Id)去掉排序最后一个套餐 + // 老版本客户端(无 X-App-Id)去掉每个套餐 discount 的最后一个 hasAppId, _ := l.ctx.Value(constant.CtxKeyHasAppId).(bool) - if !hasAppId && len(list) > 0 { - list = list[:len(list)-1] + if !hasAppId { + for i := range list { + if len(list[i].Discount) > 0 { + list[i].Discount = list[i].Discount[:len(list[i].Discount)-1] + } + } } resp.List = list