From 1acc7dc37fb2079d07b5aa1296295568f0d64160 Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期四, 20 三月 2025 15:40:42 +0800
Subject: [PATCH] fix:用户管理时间设为范围查询

---
 LifePayment/LifePayment.Application/LifePay/LifePayService.cs |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
index 0a8d5cf..6c06444 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -169,7 +169,8 @@
     {
         return await _channelFilter.GetChannelLifePayUserFilter(_lifePayUserRepository).Where(x => x.IsDeleted == false)
             .WhereIf(!string.IsNullOrEmpty(input.QueryCondition), x => x.PhoneNumber.Contains(input.QueryCondition) || x.Name.Contains(input.QueryCondition))
-            .WhereIf(input.CreationTime.HasValue, x => x.CreationTime.ToString("yyyy-MM-dd") == input.CreationTime.Value.ToString("yyyy-MM-dd"))
+            .WhereIf(input.CreationTimeBegin.HasValue, x => x.CreationTime >= input.CreationTimeBegin)
+            .WhereIf(input.CreationTimeEnd.HasValue, x => x.CreationTime <= input.CreationTimeEnd)
                                             .Select(x =>
                                                    new UserListOutput()
                                                    {
@@ -271,7 +272,9 @@
         var order = await _lifePayOrderRepository.Where(x => x.OrderNo == orderNo).FirstOrDefaultAsync();
         var platformRate = await _lifePayRateRepository.FirstOrDefaultAsync(r => r.RateType == LifePayRateTypeEnum.渚涘簲鍟嗘姌鎵d环);
         var channleRate = await _lifePayChannlesRep.FirstOrDefaultAsync(r => r.ChannlesNum == order.ChannelId);
+        var premiumRate = await _lifePayPremiumRepository.Where(x => x.IsDeleted == false && x.PremiumType == order.LifePayType).FirstOrDefaultAsync();
         CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "璁㈠崟涓嶅瓨鍦�");
+        var channlesRakePrice = (order.PayAmount - (order.PlatformDeductionAmount == null ? 0 : order.PlatformDeductionAmount)) * channleRate.ChannlesRakeRate / 100;
         var result = new LifePayOrderOutput()
                 {
             DiscountAmount = order.DiscountAmount,
@@ -299,8 +302,10 @@
             PlatformPrice = order.PlatformDeductionAmount,
             ChannleRate = channleRate.ChannlesRate,
             ChannlesRakeRate = channleRate.ChannlesRakeRate,
-            ChannlesRakePrice = (order.PayAmount - order.PlatformDeductionAmount) * channleRate.ChannlesRakeRate,
-            //PremiumRate = 
+            ChannlesRakePrice = channlesRakePrice.HasValue ? 0 : Math.Round(channlesRakePrice.Value, 2),
+            PremiumRate = premiumRate == null ? 0 : premiumRate.Rate,
+            PremiumPrice = premiumRate == null ? 0 : Math.Round(order.PayAmount * premiumRate.Rate, 2),
+            Profit = (order.PayAmount - order.PlatformDeductionAmount) * (1.00m - channleRate.ChannlesRakeRate / 100) - (premiumRate == null ? 0 : Math.Round(order.PayAmount * premiumRate.Rate, 2))
         };
 
         return result;

--
Gitblit v1.9.1