From 6b8dd8a7b4ac5d75d2e7a8c6c44d976bbd248b67 Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期三, 02 四月 2025 13:33:51 +0800
Subject: [PATCH] fix:bug修复

---
 LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs |    8 +++++++-
 LifePayment/LifePayment.Application/LifePay/LifePayService.cs      |    2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
index 0d81181..7c02e77 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
@@ -183,7 +183,13 @@
                 })
                 .GetPageResult(input.PageModel);
 
-            var totalRakePrice = await _lifePayChannlesRakeRepository.Where(x => x.IsDeleted == false).SumAsync(x => x.ChannlesRakePrice);
+            var totalRakePrice = await _lifePayChannlesRakeRepository.Where(x => x.IsDeleted == false)
+                .WhereIf(input.ChannelId.IsNotNullOrEmpty(), x => x.ChannelId == input.ChannelId)
+                .WhereIf(input.CreationTimeBegin.HasValue, x => x.CreationTime >= input.CreationTimeBegin)
+                .WhereIf(input.CreationTimeEnd.HasValue, x => x.CreationTime <= input.CreationTimeEnd)
+                .WhereIf(input.FinishTimeBegin.HasValue, x => x.FinishTime >= input.FinishTimeBegin)
+                .WhereIf(input.FinishTimeEnd.HasValue, x => x.FinishTime <= input.FinishTimeEnd)
+                .SumAsync(x => x.ChannlesRakePrice);
 
             LifePayLifePayChannlesRakeStatistics objectData = new LifePayLifePayChannlesRakeStatistics();
             objectData.TotalRakePrice = totalRakePrice;
diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
index c8f1967..4321135 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -2234,7 +2234,7 @@
         var channlesRakePrice = grossProfit * (channlesRakeRate) / 100;
 
         /// 鍒╂鼎
-        var profit = grossProfit - channlesRakePrice - (premiumRate);
+        var profit = grossProfit - channlesRakePrice - premiumPrice;
 
         return new OrderPriceReturn()
         {

--
Gitblit v1.9.1