|
@@ -565,7 +565,7 @@ public class BiSnapshotApplication : IBiSnapshotApplication, IScopeDependency
|
|
|
CommunityCode = it.Id,
|
|
|
CommunityName = it.Name,
|
|
|
CommunityFullName = it.FullName,
|
|
|
- SumCount = SqlFunc.Subqueryable<OrderSnapshot>().Where(snapshot => snapshot.CommunityFullName!.Contains(it.FullName)).Count(),
|
|
|
+ SumCount = SqlFunc.Subqueryable<OrderSnapshot>().Where(s => s.CommunityFullName!.Contains(it.FullName) && s.CreationTime >= dto.StartTime && s.CreationTime <= dto.EndTime).Count(),
|
|
|
HasChild = SqlFunc.Subqueryable<CommunityInfo>().Where(c => c.ParentCode == it.Id).Any()
|
|
|
});
|
|
|
#if DEBUG
|
|
@@ -576,10 +576,9 @@ public class BiSnapshotApplication : IBiSnapshotApplication, IScopeDependency
|
|
|
|
|
|
public ISugarQueryable<CommunityStatisticsDetailsOutDto> GetCommunityStatisticsDetails(CommunityStatisticsDetailsInDto dto)
|
|
|
{
|
|
|
- var communityFullName = _communityInfoRepository.Queryable().Where(c => c.Id == dto.CommunityCode).Select(c => c.FullName).First();
|
|
|
var query = _orderSnapshotRepository.Queryable(includeDeleted: true)
|
|
|
.LeftJoin<Order>((snapshot, order) => snapshot.Id == order.Id)
|
|
|
- .Where((snapshot, order) => snapshot.CreationTime >= dto.StartTime && snapshot.CreationTime <= dto.EndTime && snapshot.CommunityFullName!.Contains(communityFullName))
|
|
|
+ .Where((snapshot, order) => snapshot.CreationTime >= dto.StartTime && snapshot.CreationTime <= dto.EndTime && snapshot.CommunityFullName!.Contains(dto.CommunityFullName))
|
|
|
.WhereIF(dto.IndustryId.NotNullOrEmpty(), (snapshot, order) => snapshot.IndustryId == dto.IndustryId)
|
|
|
.Select((snapshot, order) => new CommunityStatisticsDetailsOutDto(), true);
|
|
|
#if DEBUG
|