From f5b64a3d8668b402b510b82fb8e871523abe17f6 Mon Sep 17 00:00:00 2001 From: lzh <1625167628@qq.com> Date: Tue, 21 Oct 2025 10:47:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3NAN=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/logic/bundleExtendLogic.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/logic/bundleExtendLogic.go b/internal/logic/bundleExtendLogic.go index e5ed7d7..919d023 100644 --- a/internal/logic/bundleExtendLogic.go +++ b/internal/logic/bundleExtendLogic.go @@ -446,8 +446,16 @@ func BundleBalanceExport(req *bundle.BundleBalanceExportReq) (*bundle.BundleBala item.TotalPayAmount = prefixItem.TotalPayAmount item.Currency = "USD" item.Fee = prefixItem.Fee - item.BundleVideoUnitPrice = float32(item.BundleAmount / float32(v.BundleVideoNumber)) - item.IncreaseVideoUnitPrice = float32(item.IncreaseAmount / float32(v.IncreaseVideoNumber)) + if v.BundleVideoNumber == 0 { + item.BundleVideoUnitPrice = 0 + } else { + item.BundleVideoUnitPrice = float32(item.BundleAmount / float32(v.BundleVideoNumber)) + } + if v.IncreaseVideoNumber == 0 { + item.IncreaseVideoUnitPrice = 0 + } else { + item.IncreaseVideoUnitPrice = float32(item.IncreaseAmount / float32(v.IncreaseVideoNumber)) + } items = append(items, item) } return &bundle.BundleBalanceExportResp{Total: int64(len(items)), Data: items}, nil