优化列表查询

This commit is contained in:
tongfei
2024-03-06 14:21:31 +08:00
parent 02acd059dd
commit 1ccb5c7ecd
3 changed files with 8 additions and 14 deletions

View File

@@ -321,10 +321,8 @@ namespace WMS.Web.Repositories
query = query.Where(w => w.detail.MaterialId == 0);
}
if (cr_ids.Count!=0)
if (!string.IsNullOrEmpty(dto.Creator))
query = query.Where(w => cr_ids.Contains(w.order.CreatorId));
else if (!string.IsNullOrEmpty(dto.Creator))
query = query.Where(w => w.order.CreatorId == 0);
if (dto.SupplierId.HasValue)
query = query.Where(w => w.detail.SupplierId == dto.SupplierId.Value);