From 52592f074c6c2b9181c3a75c43fc47ddca5e2a7d Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期二, 25 三月 2025 15:21:30 +0800
Subject: [PATCH] fix:bug修复

---
 LifePayment/LifePayment.Application/LifePay/StatisticsService.cs |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/LifePayment/LifePayment.Application/LifePay/StatisticsService.cs b/LifePayment/LifePayment.Application/LifePay/StatisticsService.cs
index 86e868f..1c873b3 100644
--- a/LifePayment/LifePayment.Application/LifePay/StatisticsService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/StatisticsService.cs
@@ -41,7 +41,7 @@
             var statistics = await _dallyStatisticsRepository.Where(x => x.CreationTime.Date == today).FirstOrDefaultAsync();
             if (statistics == null)
             {
-                var accumulatedReceipts = await _lifePayOrderRepository.Where(x => x.CreationTime < today).SumAsync(x => x.PayAmount);
+                var accumulatedReceipts = await _lifePayOrderRepository.Where(x => x.CreationTime < today && x.PayStatus == LifePayStatusEnum.宸叉敮浠�).SumAsync(x => x.PayAmount) - await _lifePayOrderRepository.Where(x => x.CreationTime < today && x.LifePayOrderStatus == LifePayOrderStatusEnum.宸查��娆�).SumAsync(x => x.RefundPrice);
                 var receiptsYesterday = await _lifePayOrderRepository.Where(x => x.CreationTime >= today.AddDays(-1) && x.CreationTime < today).SumAsync(x => x.PayAmount);
                 var accumulatedOrders = await _lifePayOrderRepository.Where(x => x.CreationTime < today).CountAsync();
                 var accumulatedIncome = await _lifePayOrderRepository.Where(x => x.CreationTime < today).SumAsync(x => x.RechargeAmount);
@@ -55,7 +55,7 @@
                     Id = GuidGenerator.Create(),
                     CreationTime = DateTime.Now,
                     Amount = 0,
-                    AccumulatedReceipts = accumulatedReceipts,
+                    AccumulatedReceipts = accumulatedReceipts.HasValue? accumulatedReceipts.Value:0,
                     AccumulatedIncome = accumulatedIncome,
                     ReceiptsYesterday = receiptsYesterday,
                     AccumulatedOrders = accumulatedOrders,

--
Gitblit v1.9.1