From 567911f4b389e0c6e548855ec10ff827a3095f33 Mon Sep 17 00:00:00 2001 From: lingling <kety1122@163.com> Date: 星期三, 19 三月 2025 16:20:23 +0800 Subject: [PATCH] Merge branch 'master' of http://120.26.58.240:8888/r/LifePaymentApi --- LifePayment/LifePayment.Domain/Common/ChannelFilter.cs | 44 +++++++++++++++++++++++++++++++------------- 1 files changed, 31 insertions(+), 13 deletions(-) diff --git a/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs b/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs index 91ae58b..11cde80 100644 --- a/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs +++ b/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs @@ -1,21 +1,39 @@ -锘縰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) + { + var queryUser = UserChannleRepository.Where(r => r.UserId == CurrentUser.Id).Select(s => s.ChannleId).ToList(); + var queryResult = query.Where(s => (s.ChannelId.HasValue && queryUser.Contains(s.ChannelId.Value)) || !s.ChannelId.HasValue); + return queryResult; + } - //public class ChannelsBase:IChannelFilter - //{ - // // public Guid ChannelId { get; set; } - //} + return query; + } + } + + public class ChannelsBase : Entity<Guid> + { + public Guid ChannleId { get; set; } + + } } -- Gitblit v1.9.1