From 836a9ca2258d92f27a749cb93fc12604dd420545 Mon Sep 17 00:00:00 2001 From: lingling <kety1122@163.com> Date: 星期三, 19 三月 2025 14:30:59 +0800 Subject: [PATCH] 添加filter --- LifePayment/LifePayment.Domain/Common/ChannelFilter.cs | 38 +++++++++++++++++++++++++------------- 1 files changed, 25 insertions(+), 13 deletions(-) diff --git a/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs b/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs index 91ae58b..f4d0a5e 100644 --- a/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs +++ b/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs @@ -1,21 +1,33 @@ -锘縰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.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 async override Task<IQueryable<ChannelsBase>> GetChannelFilter(IQueryable<ChannelsBase> query) + { + var queryUser = UserChannleRepository.Where(r => r.UserId == CurrentUser.Id).Select(s => s.ChannleId).ToList(); + var queryResult = query.Where(s => queryUser.Contains(s.ChannleId)); + return queryResult; + } + } - //public class ChannelsBase:IChannelFilter - //{ - // // public Guid ChannelId { get; set; } - //} + public class ChannelsBase : Entity<Guid> + { + public Guid ChannleId { get; set; } + + } } -- Gitblit v1.9.1