From 87b0ae0a2aca16763bf054c4c785323e36f68387 Mon Sep 17 00:00:00 2001 From: sunpengfei <i@angelzzz.com> Date: 星期三, 11 六月 2025 17:46:28 +0800 Subject: [PATCH] fix:用户端--我的--数据看板,昨日活跃用户数据统计不正确,统计的是登录账号所配置的渠道中昨日进行充值且充值成功的用户记录 --- LifePayment/LifePayment.Application/Promoter/PromoterService.cs | 30 ++++++++++++++++-------------- 1 files changed, 16 insertions(+), 14 deletions(-) diff --git a/LifePayment/LifePayment.Application/Promoter/PromoterService.cs b/LifePayment/LifePayment.Application/Promoter/PromoterService.cs index 30e1896..ac00aea 100644 --- a/LifePayment/LifePayment.Application/Promoter/PromoterService.cs +++ b/LifePayment/LifePayment.Application/Promoter/PromoterService.cs @@ -153,8 +153,8 @@ query = query.Where(s => s.Name.Contains(input.SearchKey) || s.PhoneNumber.Contains(input.SearchKey) - || s.Name.Contains(input.SearchKey) - || s.PhoneNumber.Contains(input.SearchKey)); + || s.PromoterName.Contains(input.SearchKey) + || s.PromoterPhoneNumber.Contains(input.SearchKey)); } var result = await query.GetPageResult(input.PageModel); @@ -172,6 +172,7 @@ var query = from cc in lifePayChannelConsultationRepository join p in lifePayPromoterRepository on cc.PromoterId equals p.Id into pg from pgd in pg.DefaultIfEmpty() + where cc.Id == id select new ChannelConsultationDto { Id = cc.Id, @@ -224,7 +225,7 @@ /// <param name="input"></param> /// <returns></returns> /// <exception cref="FormatException"></exception> - public async Task<Guid> CreateOrUpdatePromoter(CreateOrUpdatePromoterInput input) + public async Task<CreateOrUpdatePromoterOutput> CreateOrUpdatePromoter(CreateOrUpdatePromoterInput input) { CheckExtensions.IfTrueThrowUserFriendlyException(string.IsNullOrWhiteSpace(input.Name), "璇疯緭鍏ユ帹骞夸汉"); CheckExtensions.IfTrueThrowUserFriendlyException(string.IsNullOrWhiteSpace(input.PhoneNumber), "璇疯緭鍏ヨ仈绯绘柟寮�"); @@ -237,15 +238,8 @@ var exist = await lifePayPromoterRepository.FirstOrDefaultAsync(it => it.IdNumber == input.IdNumber || it.PhoneNumber == input.PhoneNumber); if (exist != null) { - if (exist.IdNumber == input.IdNumber) - { - throw new FormatException("璇D宸插瓨鍦�"); - } - - if (exist.PhoneNumber == input.PhoneNumber) - { - throw new FormatException("璇ユ墜鏈哄彿宸茬敵璇�"); - } + CheckExtensions.IfTrueThrowUserFriendlyException(exist.IdNumber == input.IdNumber, "璇D宸插瓨鍦�"); + CheckExtensions.IfTrueThrowUserFriendlyException(exist.PhoneNumber == input.PhoneNumber, "璇ユ墜鏈哄彿宸茬敵璇�"); } } @@ -254,7 +248,11 @@ var entity = new LifePayPromoter(); ObjectMapper.Map(input, entity); await lifePayPromoterRepository.InsertAsync(entity); - return entity.Id; + return new CreateOrUpdatePromoterOutput + { + Id = entity.Id, + IdNumber = entity.IdNumber, + }; } else { @@ -262,7 +260,11 @@ CheckExtensions.IfTrueThrowUserFriendlyException(entity == null, "璇ユ帹骞垮憳涓嶅瓨鍦�"); ObjectMapper.Map(input, entity); await lifePayPromoterRepository.UpdateAsync(entity); - return entity.Id; + return new CreateOrUpdatePromoterOutput + { + Id = entity.Id, + IdNumber = entity.IdNumber, + }; } } -- Gitblit v1.9.1