From f8e21d7b31d7690e17f5980aeb5763036dda99f0 Mon Sep 17 00:00:00 2001
From: liushijie <lslola@126.com>
Date: 星期四, 27 三月 2025 09:12:14 +0800
Subject: [PATCH] fix bug

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

diff --git a/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs b/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs
index 73aa4de..0a2bc21 100644
--- a/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs
+++ b/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs
@@ -20,11 +20,14 @@
     {
         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)) || string.IsNullOrEmpty(s.ChannelId) || queryUser.Count() == 0);
+                    return queryResult;
+                }
             }
 
             return query;
@@ -32,11 +35,15 @@
 
         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)) || string.IsNullOrEmpty(s.CreationChannleNum));
+                    return queryResult;
+                }
             }
 
             return query;

--
Gitblit v1.9.1