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