From dcd4992bc8ff63822b363e813bd612fe47ab828a Mon Sep 17 00:00:00 2001 From: zhouyonggao <1971162852@qq.com> Date: Thu, 18 Dec 2025 16:57:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(api):=20=E6=B7=BB=E5=8A=A0=E7=AB=8B?= =?UTF-8?q?=E5=87=8F=E9=87=91=E4=B8=BB=E4=BD=93=E7=B1=BB=E5=9E=8B=E6=98=A0?= =?UTF-8?q?=E5=B0=84=E5=8F=8A=E5=B1=95=E7=A4=BA=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在导出接口中将goods_voucher_subject_config.type字段的数值映射为对应标签显示 - 新增VoucherSubjectType映射,支持支付宝、微信、云闪付三种主体类型 - 修改字段标签描述,将“主体类型”更新为“立减金主体类型”以更准确表达含义 --- server/internal/api/exports.go | 9 +++++++++ server/internal/constants/enums.go | 7 +++++++ server/internal/schema/fields.go | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/server/internal/api/exports.go b/server/internal/api/exports.go index aecf11a..8a6879f 100644 --- a/server/internal/api/exports.go +++ b/server/internal/api/exports.go @@ -1146,6 +1146,15 @@ func transformRow(ds string, fields []string, vals []string) []string { } continue } + // goods_voucher_subject_config.type - 主体类型 + if f == "goods_voucher_subject_config.type" { + if n := parseIntVal(v); n >= 0 { + if label, ok := constants.VoucherSubjectType[n]; ok { + vals[i] = label + } + } + continue + } // order_cash.channel - 红包渠道 if f == "order_cash.channel" { if n := parseIntVal(v); n >= 0 { diff --git a/server/internal/constants/enums.go b/server/internal/constants/enums.go index 613af60..2244fe2 100644 --- a/server/internal/constants/enums.go +++ b/server/internal/constants/enums.go @@ -217,6 +217,13 @@ var YMTVoucherReceiveMode = map[int]string{ 2: "账号领取", } +// VoucherSubjectType 立减金主体类型映射 +var VoucherSubjectType = map[int]string{ + 1: "支付宝", + 2: "微信", + 3: "云闪付", +} + // OrderDigitOrderType 数字订单类型映射 var OrderDigitOrderType = map[int]string{ 1: "直充", diff --git a/server/internal/schema/fields.go b/server/internal/schema/fields.go index f1431b3..5e399f9 100644 --- a/server/internal/schema/fields.go +++ b/server/internal/schema/fields.go @@ -199,7 +199,7 @@ func AllLabels() map[string]string { "goods_voucher_batch.update_time": "更新时间", "goods_voucher_subject_config.id": "主体配置ID", "goods_voucher_subject_config.name": "主体名称", - "goods_voucher_subject_config.type": "主体类型", + "goods_voucher_subject_config.type": "立减金主体类型", "goods_voucher_subject_config.create_time": "创建时间", "merchant.id": "客户ID", "merchant.name": "客户名称",