From f6e7fa2f4a8258a727179aa1aa7cf4e36d80076a Mon Sep 17 00:00:00 2001 From: MSuMshk <2039814060@qq.com> Date: Mon, 15 Dec 2025 09:45:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B9=B3=E5=8F=B0=E7=A7=9F=E6=88=B7?= =?UTF-8?q?=E6=9C=AA=E8=A7=A3=E6=9E=90=E6=97=B6=E4=B8=8D=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E7=A7=9F=E6=88=B7=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/Persistence/TenantAwareDbContext.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/TenantAwareDbContext.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/TenantAwareDbContext.cs index 66e0f41..19cf5ca 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/TenantAwareDbContext.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/TenantAwareDbContext.cs @@ -61,7 +61,7 @@ public abstract class TenantAwareDbContext( private void SetTenantFilter(ModelBuilder modelBuilder) where TEntity : class, IMultiTenantEntity { - modelBuilder.Entity().HasQueryFilter(entity => entity.TenantId == CurrentTenantId); + modelBuilder.Entity().HasQueryFilter(entity => CurrentTenantId == 0 || entity.TenantId == CurrentTenantId); } ///