修复:Admin租户配额查询返回空数据(忽略全局租户过滤)
This commit is contained in:
@@ -92,7 +92,9 @@ public sealed class EfQuotaPackageRepository(TakeoutAppDbContext context) : IQuo
|
|||||||
int pageSize,
|
int pageSize,
|
||||||
CancellationToken cancellationToken = default)
|
CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
var query = context.TenantQuotaPackagePurchases.AsNoTracking()
|
var query = context.TenantQuotaPackagePurchases
|
||||||
|
.IgnoreQueryFilters()
|
||||||
|
.AsNoTracking()
|
||||||
.Where(x => x.TenantId == tenantId && x.DeletedAt == null);
|
.Where(x => x.TenantId == tenantId && x.DeletedAt == null);
|
||||||
|
|
||||||
var total = await query.CountAsync(cancellationToken);
|
var total = await query.CountAsync(cancellationToken);
|
||||||
@@ -126,7 +128,9 @@ public sealed class EfQuotaPackageRepository(TakeoutAppDbContext context) : IQuo
|
|||||||
TenantQuotaType? quotaType,
|
TenantQuotaType? quotaType,
|
||||||
CancellationToken cancellationToken = default)
|
CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
var query = context.TenantQuotaUsages.AsNoTracking()
|
var query = context.TenantQuotaUsages
|
||||||
|
.IgnoreQueryFilters()
|
||||||
|
.AsNoTracking()
|
||||||
.Where(x => x.TenantId == tenantId);
|
.Where(x => x.TenantId == tenantId);
|
||||||
|
|
||||||
if (quotaType.HasValue)
|
if (quotaType.HasValue)
|
||||||
@@ -144,6 +148,7 @@ public sealed class EfQuotaPackageRepository(TakeoutAppDbContext context) : IQuo
|
|||||||
CancellationToken cancellationToken = default)
|
CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
return context.TenantQuotaUsages
|
return context.TenantQuotaUsages
|
||||||
|
.IgnoreQueryFilters()
|
||||||
.FirstOrDefaultAsync(x => x.TenantId == tenantId && x.QuotaType == quotaType, cancellationToken);
|
.FirstOrDefaultAsync(x => x.TenantId == tenantId && x.QuotaType == quotaType, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user