fix: 老版本客户端去掉每个套餐 discount 最后一个,而非整个套餐

This commit is contained in:
shanshanzhong 2026-03-29 03:19:15 -07:00
parent 3b4e882965
commit 1dbc3a81e9

View File

@ -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