解决NAN错误
This commit is contained in:
parent
7c30bac725
commit
f5b64a3d86
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user