diff --git a/BBWY.Server.Business/Statistics/StatisticsBusiness.cs b/BBWY.Server.Business/Statistics/StatisticsBusiness.cs index 79677e74..719ecead 100644 --- a/BBWY.Server.Business/Statistics/StatisticsBusiness.cs +++ b/BBWY.Server.Business/Statistics/StatisticsBusiness.cs @@ -372,12 +372,16 @@ namespace BBWY.Server.Business o.OrderState == Enums.OrderState.等待采购 && o.StartTime >= dt).Count(); response.ExceptionCount = fsql.Select().LeftJoin((o, oc) => o.Id == oc.OrderId) - .Where((o, oc) => o.ShopId == shopId && o.StartTime >= dt && + .Where((o, oc) => o.ShopId == shopId && + o.StartTime >= dt && o.IsGift == false && - o.OrderState != Enums.OrderState.已取消 && - ((o.StorageType != Enums.StorageType.SD && o.StorageType != null && oc.PurchaseAmount == 0M) || - (o.StorageType != Enums.StorageType.SD && oc.PurchaseAmount + oc.DeliveryExpressFreight > o.OrderSellerPrice + o.FreightPrice + o.PingTaiChengDanYouHuiQuan) || - (o.StorageType == null && o.OrderState != Enums.OrderState.等待采购))).Count(); + ((o.OrderState != Enums.OrderState.已取消 && + o.StorageType != Enums.StorageType.SD && + o.StorageType != null && + (oc.PurchaseAmount == 0M || oc.Profit < 0)) || + (o.StorageType == null && + o.OrderState != Enums.OrderState.等待采购 && + o.OrderState != Enums.OrderState.待付款))).Count(); response.WaitOutStoreCount = fsql.Select().Where(o => o.ShopId == shopId && o.OrderState == Enums.OrderState.待出库 && o.StartTime >= dt && o.IsGift == false).Count();