修复财务仪表盘日明细
This commit is contained in:
@@ -118,8 +118,9 @@ func (r *Repository) dailyItems(ctx context.Context, query DashboardQuery) ([]Fi
|
||||
itemsByDate[date] = FinanceDailyDTO{Date: date}
|
||||
}
|
||||
for _, row := range payments {
|
||||
item := itemsByDate[row.Date]
|
||||
item.Date = row.Date
|
||||
date := dailyDateKey(row.Date)
|
||||
item := itemsByDate[date]
|
||||
item.Date = date
|
||||
item.TotalFlowAmountCent = row.TotalFlowAmountCent
|
||||
item.TotalRefundAmountCent = row.TotalRefundAmountCent
|
||||
item.PendingRefundAmountCent = row.PendingRefundAmountCent
|
||||
@@ -127,17 +128,18 @@ func (r *Repository) dailyItems(ctx context.Context, query DashboardQuery) ([]Fi
|
||||
item.SuccessfulPayCount = row.SuccessfulPayCount
|
||||
item.SuccessfulRefundCount = row.SuccessfulRefundCount
|
||||
item.PendingRefundCount = row.PendingRefundCount
|
||||
itemsByDate[row.Date] = item
|
||||
itemsByDate[date] = item
|
||||
}
|
||||
for _, row := range settlements {
|
||||
item := itemsByDate[row.Date]
|
||||
item.Date = row.Date
|
||||
date := dailyDateKey(row.Date)
|
||||
item := itemsByDate[date]
|
||||
item.Date = date
|
||||
item.PlatformIncomeAmountCent = row.PlatformIncomeAmountCent
|
||||
item.OwnerShouldIncomeAmountCent = row.OwnerShouldIncomeAmountCent
|
||||
item.OwnerWalletIncomeAmountCent = row.OwnerWalletIncomeAmountCent
|
||||
item.SettlementDiffAmountCent = row.OwnerShouldIncomeAmountCent - row.OwnerWalletIncomeAmountCent
|
||||
item.SettledOrderCount = row.SettledOrderCount
|
||||
itemsByDate[row.Date] = item
|
||||
itemsByDate[date] = item
|
||||
}
|
||||
|
||||
items := make([]FinanceDailyDTO, 0, len(itemsByDate))
|
||||
|
||||
Reference in New Issue
Block a user