diff --git a/Myshipping.Core/Service/DjyWebsiteAccountConfig/DjyWebsiteAccountConfigService.cs b/Myshipping.Core/Service/DjyWebsiteAccountConfig/DjyWebsiteAccountConfigService.cs index 8d3416b2..4d5c1275 100644 --- a/Myshipping.Core/Service/DjyWebsiteAccountConfig/DjyWebsiteAccountConfigService.cs +++ b/Myshipping.Core/Service/DjyWebsiteAccountConfig/DjyWebsiteAccountConfigService.cs @@ -109,9 +109,10 @@ namespace Myshipping.Core.Service [HttpGet("/DjyWebsiteAccountConfig/PageTenant")] public async Task PageTenant([FromQuery] QueryDjyWebsiteAccountConfigInput input) { - var entities = await _rep.AsQueryable() + var entities = await _rep.AsQueryable().Filter(null, true) + .Where(m => m.TenantId == UserManager.TENANT_ID) .Where(m => m.IsTenant) - .Where(m => m.CreatedUserId == UserManager.UserId) + .Where(m => !m.IsDeleted) .WhereIF(!string.IsNullOrWhiteSpace(input.TypeCode), u => u.TypeCode == input.TypeCode) .WhereIF(!string.IsNullOrWhiteSpace(input.Account), u => u.Account.Contains(input.Account.Trim())) .ToPagedListAsync(input.PageNo, input.PageSize); @@ -179,13 +180,15 @@ namespace Myshipping.Core.Service /// public async Task GetAccountConfig(string TypeCode, long UserId) { - if (string.IsNullOrWhiteSpace(TypeCode)||UserId==0) { + if (string.IsNullOrWhiteSpace(TypeCode) || UserId == 0) + { throw Oops.Bah("请传入正确参数!"); } DjyWebsiteAccountConfig accountConfig = new DjyWebsiteAccountConfig(); accountConfig = await _rep.FirstOrDefaultAsync(x => x.TypeCode == TypeCode && x.CreatedUserId == UserId); - if (accountConfig==null) { - accountConfig = await _rep.AsQueryable().InnerJoin((d,t)=>d.TenantId==t.TenantId).Where((d,t)=>d.TypeCode==TypeCode&&t.Id==UserId&&d.IsTenant==true).FirstAsync(); + if (accountConfig == null) + { + accountConfig = await _rep.AsQueryable().InnerJoin((d, t) => d.TenantId == t.TenantId).Where((d, t) => d.TypeCode == TypeCode && t.Id == UserId && d.IsTenant == true).FirstAsync(); } return accountConfig; }