From f541a7a30bc06e478a1f11d31e20019dc33e5309 Mon Sep 17 00:00:00 2001 From: zhouyonggao <1971162852@qq.com> Date: Mon, 15 Dec 2025 18:21:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(api):=20=E5=A2=9E=E5=BC=BA=E6=98=93?= =?UTF-8?q?=E7=A0=81=E9=80=9A=E6=95=B0=E6=8D=AE=E5=AF=BC=E5=87=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BB=A5=E4=BC=98=E5=8C=96=E5=AD=97=E6=AE=B5=E5=8E=BB?= =?UTF-8?q?=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在exports.go中新增逻辑,针对易码通数据处理时,保留order_voucher.grant_time字段并移除order_cash.receive_time字段,避免返回空值。此改动提升了字段去重的准确性,确保导出数据符合预期。 --- server/internal/api/exports.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/server/internal/api/exports.go b/server/internal/api/exports.go index 29658ef..0d98916 100644 --- a/server/internal/api/exports.go +++ b/server/internal/api/exports.go @@ -300,6 +300,22 @@ func (a *ExportsAPI) create(w http.ResponseWriter, r *http.Request) { filtered = deduped } } + // 易码通立减金:保留 order_voucher.grant_time,移除红包领取时间列,避免“领取时间”为空 + if ds == "ymt" && tv == 3 { + deduped := make([]string, 0, len(filtered)) + removed := []string{} + for _, tf := range filtered { + if tf == "order_cash.receive_time" { + removed = append(removed, tf) + continue + } + deduped = append(deduped, tf) + } + if len(removed) > 0 { + logging.JSON("INFO", map[string]interface{}{"event": "fields_deduplicated_receive_time", "removed": removed, "reason": "立减金保留 order_voucher.grant_time"}) + } + filtered = deduped + } // 易码通客户名称字段去重:若同时选择 order.merchant_name 与 merchant.name,仅保留 merchant.name if ds == "ymt" { hasOrderMerchant := false