From 65beca31c74c6313519ba51ac2a3302659172eab Mon Sep 17 00:00:00 2001 From: zhengyuxuan <zhengyuxuan1995> Date: 星期一, 31 三月 2025 10:40:04 +0800 Subject: [PATCH] fix:新增渠道查询接口 --- LifePayment/LifePayment.Application/User/AccountService.cs | 25 +++++++++++++++++++++---- 1 files changed, 21 insertions(+), 4 deletions(-) diff --git a/LifePayment/LifePayment.Application/User/AccountService.cs b/LifePayment/LifePayment.Application/User/AccountService.cs index 43aeddb..7ba7018 100644 --- a/LifePayment/LifePayment.Application/User/AccountService.cs +++ b/LifePayment/LifePayment.Application/User/AccountService.cs @@ -92,10 +92,27 @@ return result; } - //public async Task<UserChannelOutput> GetUserChannel() - //{ - // var userchannel = await _userChannleRep.Where - //} + + public async Task<List<ChannelOutput>> GetUserChannel() + { + var userchannel = await _userChannleRep.Where(x => x.UserId == CurrentUser.Id) + .Select(s => new ChannelOutput() + { + Name = _lifePayChannlesRepository.Where(x => x.ChannlesNum == s.ChannleId).Select(r => r.ChannlesName).FirstOrDefault(), + ChannlesNum = s.ChannleId + }).ToListAsync(); + if (userchannel.Count() == 0) + { + userchannel = await _lifePayChannlesRepository + .Select(s => new ChannelOutput() + { + Name = s.ChannlesName, + ChannlesNum = s.ChannlesNum + }).ToListAsync(); + } + + return userchannel; + } #endregion -- Gitblit v1.9.1