fix 查询优化

This commit is contained in:
2024-04-10 14:38:34 +08:00
parent 1fdfec7799
commit f88f67934e
7 changed files with 48 additions and 67 deletions

View File

@@ -1,7 +1,6 @@
using Dlhis.Canteen.Setting.Request;
using Dlhis.Canteen.Setting.Response;
using Dlhis.Canteen.Setting.Services;
using Dlhis.Entity.Canteen.Enums;
using Kurisu.Core.DataAccess.Dto;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

View File

@@ -87,9 +87,8 @@ public class CanteenSettingService : ICanteenSettingService
var settings = await _context.Queryable<CanteenSettingEntity>()
.Where(x => x.Enable)
.Where(x => x.TenantId == tenantId)
.Where(x =>
(x.UniqueType == CanteenSettingUnqiueEnumType.Person && x.UniqueValue == userNo)
|| x.UniqueType == CanteenSettingUnqiueEnumType.Tenant)
.Where(x => (x.UniqueType == CanteenSettingUnqiueEnumType.Person && x.UniqueValue == userNo)
|| x.UniqueType == CanteenSettingUnqiueEnumType.Tenant)
.ToListAsync();
//从基地 -> 个人,确保下面循环做到覆盖,并且以个人配置为主