From 79421b33e9936816065a545c3b4534f342b6f33d Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期四, 27 三月 2025 10:27:07 +0800
Subject: [PATCH] fix:bug修复

---
 LifePayment/LifePayment.Application/LifePay/LifePayService.cs |   46 +++++++++++++++++++++++++++++++---------------
 1 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
index 405d11c..d422ac7 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -194,6 +194,8 @@
             .WhereIf(!string.IsNullOrEmpty(input.QueryCondition), x => x.PhoneNumber.Contains(input.QueryCondition) || x.Name.Contains(input.QueryCondition))
             .WhereIf(input.CreationTimeBegin.HasValue, x => x.CreationTime >= input.CreationTimeBegin)
             .WhereIf(input.CreationTimeEnd.HasValue, x => x.CreationTime <= input.CreationTimeEnd)
+            .WhereIf(input.LoginTimeBegin.HasValue, x => x.LastLoginTime >= input.LoginTimeBegin)
+            .WhereIf(input.LoginTimeEnd.HasValue, x => x.LastLoginTime <= input.LoginTimeEnd)
                                             .Select(x =>
                                                    new UserListOutput()
                                                    {
@@ -1537,7 +1539,7 @@
             var userAccount = await _lifePayAccount.Where(x => x.UserId == input.UserId && x.Id == input.Id)
                                             .FirstOrDefaultAsync();
             CheckExtensions.IfTrueThrowUserFriendlyException(userAccount == null, "鎴峰彿涓嶅瓨鍦�");
-            var repeatAccountContent = await _lifePayAccount.Where(x => x.UserId == input.UserId && x.LifePayType == input.LifePayType && x.Content == input.Content && x.Id != input.Id)
+            var repeatAccountContent = await _lifePayAccount.Where(x => x.UserId == input.UserId && x.LifePayType == input.LifePayType && x.Content == input.Content && x.Id != input.Id && x.IsDeleted == false)
                                             .FirstOrDefaultAsync();
             CheckExtensions.IfTrueThrowUserFriendlyException(repeatAccountContent != null, "鎴峰彿宸插瓨鍦�");
 
@@ -1551,22 +1553,36 @@
         }
         else
         {
-            var repeatAccountContent = await _lifePayAccount.Where(x => x.UserId == input.UserId && x.LifePayType == input.LifePayType && x.Content == input.Content)
+            var repeatAccountContent = await _lifePayAccount.Where(x => x.UserId == input.UserId && x.LifePayType == input.LifePayType && x.Content == input.Content && x.IsDeleted == false)
                                             .FirstOrDefaultAsync();
-            CheckExtensions.IfTrueThrowUserFriendlyException(repeatAccountContent != null, "鎴峰彿宸插瓨鍦�");
-            var userAccount = new LifePayAccount
+            /// CheckExtensions.IfTrueThrowUserFriendlyException(repeatAccountContent != null, "鎴峰彿宸插瓨鍦�");
+            if (repeatAccountContent != null)
             {
-                Id = Guid.NewGuid(),
-                UserId = input.UserId,
-                Content = input.Content,
-                Province = input.Province,
-                LifePayType = input.LifePayType,
-                City = input.City,
-                Remark = input.Remark,
-                Operators = input.Operators,
-                ExtraProperties = input.ExtraProperties,
-            };
-            await _lifePayAccount.InsertAsync(userAccount);
+                repeatAccountContent.LifePayType = input.LifePayType;
+                repeatAccountContent.Content = input.Content;
+                repeatAccountContent.Province = input.Province;
+                repeatAccountContent.City = input.City;
+                repeatAccountContent.Remark = input.Remark;
+                repeatAccountContent.Operators = input.Operators;
+                repeatAccountContent.ExtraProperties = input.ExtraProperties;
+            }
+            else
+            {
+                var userAccount = new LifePayAccount
+                {
+                    Id = Guid.NewGuid(),
+                    UserId = input.UserId,
+                    Content = input.Content,
+                    Province = input.Province,
+                    LifePayType = input.LifePayType,
+                    City = input.City,
+                    Remark = input.Remark,
+                    Operators = input.Operators,
+                    ExtraProperties = input.ExtraProperties,
+                };
+                await _lifePayAccount.InsertAsync(userAccount);
+            }
+            
         }
 
         if (input.LifePayType == LifePayOrderTypeEnum.璇濊垂璁㈠崟)

--
Gitblit v1.9.1