From 08434cfa320acdb07ed8555fa83e99614ac3f211 Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Fri, 12 Jun 2026 20:35:27 -0700 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=8A=9F=E8=83=BD:=20=E4=BD=A3?= =?UTF-8?q?=E9=87=91=E5=9B=9E=E9=80=80=E6=97=A5=E5=BF=97=20content=20?= =?UTF-8?q?=E6=94=B9=E6=88=90=E4=B8=AD=E6=96=87=E5=8F=8B=E5=A5=BD=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 之前接口返回原始 JSON 字符串(前端不好展示): "{\"type\":333,\"amount\":-649,\"order_no\":\"xxx\",\"timestamp\":\"...\"}" 改为可读文字: 333 订单退款回佣 → "订单退款回佣(订单号 xxx)" 337 提现驳回 → "提现申请被驳回,佣金已退回" 338 提现取消 → "已取消提现,佣金已退回" 同时影响以下两个接口的 content 字段: - /v1/public/user/withdrawal_log?biz_type=commission_refund (deprecated) - /v1/public/user/commission_return_log --- .../user/queryCommissionReturnLogLogic.go | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/internal/logic/public/user/queryCommissionReturnLogLogic.go b/internal/logic/public/user/queryCommissionReturnLogLogic.go index 66f627c..ca1a059 100644 --- a/internal/logic/public/user/queryCommissionReturnLogLogic.go +++ b/internal/logic/public/user/queryCommissionReturnLogLogic.go @@ -142,7 +142,7 @@ func (l *QueryCommissionReturnLogLogic) queryCommissionReturnLogRecordsByEventTy UserID: row.ObjectID, Amount: content.Amount, EventType: content.Type, - Content: row.Content, + Content: commissionReturnLogContentText(content.Type, content.OrderNo), CreatedAt: timestamp, UpdatedAt: timestamp, }) @@ -163,3 +163,21 @@ func isCommissionReturnEventType(eventType uint16) bool { return false } } + +// commissionReturnLogContentText 把佣金回退事件的原始 JSON 转成前端友好文字。 +// 333 订单退款回佣 - 附订单号便于追溯;337/338 提现相关 - 跟订单无关。 +func commissionReturnLogContentText(eventType uint16, orderNo string) string { + switch eventType { + case log.CommissionTypeRefund: + if strings.TrimSpace(orderNo) != "" { + return "订单退款回佣(订单号 " + orderNo + ")" + } + return "订单退款回佣" + case log.CommissionTypeWithdrawReject: + return "提现申请被驳回,佣金已退回" + case log.CommissionTypeWithdrawCancel: + return "已取消提现,佣金已退回" + default: + return "佣金调整" + } +}