|
@@ -4586,7 +4586,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
.Includes(d => d.Order, d => d.OrderTags)
|
|
|
.Includes(d => d.Employee)
|
|
|
.Includes(d => d.OrderVisitDetails)
|
|
|
- .Includes(d => d.Order, d => d.OrderVisits)
|
|
|
+ .Includes(d => d.Order, d => d.OrderVisits.Where(x => x.VisitState == EVisitState.Visited))
|
|
|
.Where(d => d.VisitTime >= dto.StartTime && d.VisitTime <= dto.EndTime && d.VisitType != null && d.EmployeeId != "" && d.EmployeeId != null)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.UserID), d => !string.IsNullOrEmpty(d.EmployeeId) && d.EmployeeId == dto.UserID)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.UserName), d => d.Employee.Name == dto.UserName)
|
|
@@ -4644,7 +4644,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
var query = _orderVisitRecordRepository.Queryable()
|
|
|
.Includes(d => d.Order, d => d.OrderTags)
|
|
|
.Includes(d => d.Employee)
|
|
|
- .Includes(d => d.Order, d => d.OrderVisits)
|
|
|
+ .Includes(d => d.Order, d => d.OrderVisits.Where(x => x.VisitState == EVisitState.Visited))
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.UserID), d => !string.IsNullOrEmpty(d.EmployeeId) && d.EmployeeId == dto.UserID)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.UserName), d => d.Employee.Name == dto.UserName)
|
|
|
.WhereIF(dto.StartTime != null, d => d.VisitTime >= dto.StartTime && d.VisitType != null && d.EmployeeId != "" && d.EmployeeId != null)
|