From 02560316633da0dd2051014a99bd4153150b2fb5 Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期一, 07 四月 2025 10:50:55 +0800
Subject: [PATCH] fix:bug修复

---
 LifePayment/LifePayment.Domain/Common/ChannelFilter.cs |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs b/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs
index 521da7e..2043352 100644
--- a/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs
+++ b/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs
@@ -18,13 +18,16 @@
 {
     public class ChannelFilter : AbstractChannelFilter
     {
-        public  override IQueryable<LifePayOrder> GetChannelLifePayOrderFilter(IQueryable<LifePayOrder> query)
+        public override IQueryable<LifePayOrder> GetChannelLifePayOrderFilter(IQueryable<LifePayOrder> query)
         {
-            if (CurrentUser.ClientId == Constant.ClientType.Back)
+            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));
-                return queryResult;
+                if (queryUser.Count() > 0)
+                {
+                    var queryResult = query.Where(s => (!string.IsNullOrEmpty(s.ChannelId) && queryUser.Contains(s.ChannelId)));
+                    return queryResult;
+                }
             }
 
             return query;
@@ -32,11 +35,14 @@
 
         public override IQueryable<LifePayUser> GetChannelLifePayUserFilter(IQueryable<LifePayUser> query)
         {
-            if (CurrentUser.ClientId == Constant.ClientType.Back)
+            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)));
+                    return queryResult;
+                }
             }
 
             return query;

--
Gitblit v1.9.1