From a7364f0b20a2025585dbbddd52fa42bc4b51e86d Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期一, 09 六月 2025 11:26:13 +0800
Subject: [PATCH] feat:根据用户ID获取用户是否为后台管理员 新增字段promoterIdNumber

---
 LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs |    5 +++++
 LifePayment/LifePayment.Application/User/AccountService.cs             |   11 ++++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
index 3cad7a6..2cd8b14 100644
--- a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
+++ b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
@@ -1234,6 +1234,11 @@
     public Guid UserId { get; set; }
 
     /// <summary>
+    /// 鎺ㄥ箍鍛業D
+    /// </summary>
+    public string PromoterIdNumber { get; set; }
+
+    /// <summary>
     /// 鏄惁鏄悗鍙扮敤鎴�
     /// </summary>
     public bool IsBackClientUser { get; set; }
diff --git a/LifePayment/LifePayment.Application/User/AccountService.cs b/LifePayment/LifePayment.Application/User/AccountService.cs
index 936156c..740211b 100644
--- a/LifePayment/LifePayment.Application/User/AccountService.cs
+++ b/LifePayment/LifePayment.Application/User/AccountService.cs
@@ -1,6 +1,7 @@
 锘�
 using LifePayment.Application.Contracts;
 using LifePayment.Domain;
+using LifePayment.Domain.LifePay;
 using LifePayment.Domain.Models;
 using LifePayment.Domain.Shared;
 using Microsoft.EntityFrameworkCore;
@@ -36,6 +37,7 @@
         private readonly IRepository<User, Guid> _userRepository;
         private readonly IRepository<UserChannle, Guid> _userChannleRep;
         private readonly IIdentityUserAppService _identityUserService;
+        private readonly IRepository<LifePayPromoter, Guid> lifePayPromoterRepository;
         private readonly IDistributedCache<string> _distributedCache;
 
 
@@ -45,6 +47,7 @@
                IIdentityModelAuthenticationService authenticator,
                IRepository<User, Guid> userRepository,
                IIdentityUserAppService identityUserService,
+               IRepository<LifePayPromoter, Guid> lifePayPromoterRepository,
                IRepository<LifePayUser, Guid> lifePayUserRepository,
                IRepository<LifePayChannles, Guid> lifePayChannlesRepository,
                IRepository<UserChannle, Guid> userChannleRep,
@@ -53,6 +56,7 @@
             _configuration = configuration;
             _wxManager = wxManager;
             _identityUserService = identityUserService;
+            this.lifePayPromoterRepository = lifePayPromoterRepository;
             _lifePayUserRepository = lifePayUserRepository;
             _lifePayChannlesRepository = lifePayChannlesRepository;
             _authenticator = authenticator;
@@ -178,9 +182,14 @@
             var lifeUser = await _lifePayUserRepository.Where(x => x.Id == id).FirstOrDefaultAsync();
             CheckExtensions.IfTrueThrowUserFriendlyException(lifeUser == null,
                                                              "鐢ㄦ埛涓嶅瓨鍦�");
-
             var result = await LifePayUserMesssageByPhone(lifeUser.PhoneNumber);
             result.UserId = id;
+            var promoter = await lifePayPromoterRepository.FirstOrDefaultAsync(it => it.PhoneNumber == lifeUser.PhoneNumber);
+            if (promoter != null)
+            {
+                result.PromoterIdNumber = promoter.IdNumber;
+            }
+
             return result;
         }
 

--
Gitblit v1.9.1