From 2a2946b36bffbe07931adc8594887064531230de Mon Sep 17 00:00:00 2001 From: zhengyuxuan <zhengyuxuan1995> Date: 星期二, 25 三月 2025 16:09:06 +0800 Subject: [PATCH] fix:内部账号去除过滤 --- LifePayment/LifePayment.Domain/Common/ChannelFilter.cs | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs b/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs index 30aa047..0a2bc21 100644 --- a/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs +++ b/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs @@ -23,8 +23,11 @@ if (CurrentUser.ClientId == Constant.ClientType.Back && !CurrentUser.IsSystem) { var queryUser = UserChannleRepository.Where(r => r.UserId == CurrentUser.Id).Select(s => s.ChannleId).ToList(); - var queryResult = query.Where(s => (!string.IsNullOrEmpty(s.ChannelId) && queryUser.Contains(s.ChannelId)) || string.IsNullOrEmpty(s.ChannelId) || queryUser.Count() == 0); - return queryResult; + if (queryUser.Count() > 0) + { + var queryResult = query.Where(s => (!string.IsNullOrEmpty(s.ChannelId) && queryUser.Contains(s.ChannelId)) || string.IsNullOrEmpty(s.ChannelId) || queryUser.Count() == 0); + return queryResult; + } } return query; @@ -35,8 +38,12 @@ if (CurrentUser.ClientId == Constant.ClientType.Back && !CurrentUser.IsSystem) { var queryUser = UserChannleRepository.Where(r => r.UserId == CurrentUser.Id).Select(s => s.ChannleId).ToList(); - var queryResult = query.Where(s => (!string.IsNullOrEmpty(s.CreationChannleNum) && queryUser.Contains(s.CreationChannleNum)) || string.IsNullOrEmpty(s.CreationChannleNum)); - return queryResult; + if (queryUser.Count() > 0) + { + + var queryResult = query.Where(s => (!string.IsNullOrEmpty(s.CreationChannleNum) && queryUser.Contains(s.CreationChannleNum)) || string.IsNullOrEmpty(s.CreationChannleNum)); + return queryResult; + } } return query; -- Gitblit v1.9.1