From 06f7ccdea12e211d05f6eef75e6e2fb4b493377c Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期四, 03 四月 2025 16:02:50 +0800
Subject: [PATCH] fix:验重

---
 LifePayment/LifePayment.Application/LifePay/StatisticsService.cs |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/LifePayment/LifePayment.Application/LifePay/StatisticsService.cs b/LifePayment/LifePayment.Application/LifePay/StatisticsService.cs
index c1e6c49..a4e22f2 100644
--- a/LifePayment/LifePayment.Application/LifePay/StatisticsService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/StatisticsService.cs
@@ -144,14 +144,16 @@
 
             foreach (var item in groupedStatistics)
             {
+                /// 瀹為檯鏀舵鏃ユ湡
+                var creationTime = item.CreationTime.AddDays(-1).ToString("yyyy-MM-dd");
                 ReceiptsDetail receive = new ReceiptsDetail()
                 {
-                    CreationTime = item.CreationTime.AddDays(-1).ToString("yyyy-MM-dd"),
+                    CreationTime = creationTime,
                     Amount = item.TotalReceiptsYesterday
                 };
                 ReceiptsDetail income = new ReceiptsDetail()
                 {
-                    CreationTime = item.CreationTime.AddDays(-1).ToString("yyyy-MM-dd"),
+                    CreationTime = creationTime,
                     Amount = item.TotalIncomeYesterday
                 };
                 receiptsListOutPut.ReceiveList.Add(receive);
@@ -184,12 +186,16 @@
 
             ChannlesRakeListOutPut channlesRakeListOutPut = new ChannlesRakeListOutPut();
 
-            foreach (var item in groupedStatistics)
+            var dateList = Enumerable.Range(1, 31)
+                        .Select(i => today.AddDays(-i))
+                        .ToList();
+            foreach (var date in dateList)
             {
+                var stat = groupedStatistics.FirstOrDefault(g => g.FinishTime == date.ToString("yyyy-MM-dd"));
                 ReceiptsDetail receive = new ReceiptsDetail()
                 {
-                    CreationTime = item.FinishTime,
-                    Amount = item.ChannlesRakePrice
+                    CreationTime = date.ToString("yyyy-MM-dd"),
+                    Amount = stat?.ChannlesRakePrice ?? 0
                 };
                 channlesRakeListOutPut.ChannlesRakeList.Add(receive);
             }

--
Gitblit v1.9.1