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.Domain/Common/ChannelFilter.cs | 62 ++++++++++++++++++++++++------ 1 files changed, 49 insertions(+), 13 deletions(-) diff --git a/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs b/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs index 91ae58b..2043352 100644 --- a/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs +++ b/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs @@ -1,21 +1,57 @@ -锘縰sing System; +锘縰sing LifePayment.Application.Contracts; +using LifePayment.Domain; +using LifePayment.Domain.Models; +using Microsoft.EntityFrameworkCore; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; +using System.Threading.Channels; using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Repositories; +using Z.EntityFramework.Plus; +using ZeroD.Util; namespace LifePayment.Domain.Common { - //public class ChannelFilter : AbstractChannelFilter - //{ - // public async Task<IQueryable<ChannelsBase>> GetPolicyFilter<ChannelsBase, TKey>(IQueryable<ChannelsBase> query) - // { - // throw new NotImplementedException(); - // } - //} + public class ChannelFilter : AbstractChannelFilter + { + public override IQueryable<LifePayOrder> GetChannelLifePayOrderFilter(IQueryable<LifePayOrder> query) + { + if (CurrentUser.ClientId == Constant.ClientType.Back && !CurrentUser.IsSystem) + { + var queryUser = UserChannleRepository.Where(r => r.UserId == CurrentUser.Id).Select(s => s.ChannleId).ToList(); + if (queryUser.Count() > 0) + { + var queryResult = query.Where(s => (!string.IsNullOrEmpty(s.ChannelId) && queryUser.Contains(s.ChannelId))); + return queryResult; + } + } - //public class ChannelsBase:IChannelFilter - //{ - // // public Guid ChannelId { get; set; } - //} + return query; + } + + public override IQueryable<LifePayUser> GetChannelLifePayUserFilter(IQueryable<LifePayUser> query) + { + if (CurrentUser.ClientId == Constant.ClientType.Back && !CurrentUser.IsSystem) + { + var queryUser = UserChannleRepository.Where(r => r.UserId == CurrentUser.Id).Select(s => s.ChannleId).ToList(); + if (queryUser.Count() > 0) + { + var queryResult = query.Where(s => (!string.IsNullOrEmpty(s.CreationChannleNum) && queryUser.Contains(s.CreationChannleNum))); + return queryResult; + } + } + + return query; + } + } + + public class ChannelsBase : Entity<Guid> + { + public Guid ChannleId { get; set; } + + } } -- Gitblit v1.9.1