| | |
| | | var statistics = await _dallyStatisticsRepository.Where(x => x.CreationTime.Date == today).FirstOrDefaultAsync(); |
| | | if (statistics == null) |
| | | { |
| | | var accumulatedReceipts = await _lifePayOrderRepository.Where(x => x.CreationTime < today).SumAsync(x => x.PayAmount); |
| | | var accumulatedReceipts = await _lifePayOrderRepository.Where(x => x.CreationTime < today && x.PayStatus == LifePayStatusEnum.已支付).SumAsync(x => x.PayAmount) - await _lifePayOrderRepository.Where(x => x.CreationTime < today && x.LifePayOrderStatus == LifePayOrderStatusEnum.已退款).SumAsync(x => x.RefundPrice); |
| | | var receiptsYesterday = await _lifePayOrderRepository.Where(x => x.CreationTime >= today.AddDays(-1) && x.CreationTime < today).SumAsync(x => x.PayAmount); |
| | | var accumulatedOrders = await _lifePayOrderRepository.Where(x => x.CreationTime < today).CountAsync(); |
| | | var accumulatedIncome = await _lifePayOrderRepository.Where(x => x.CreationTime < today).SumAsync(x => x.RechargeAmount); |
| | |
| | | Id = GuidGenerator.Create(), |
| | | CreationTime = DateTime.Now, |
| | | Amount = 0, |
| | | AccumulatedReceipts = accumulatedReceipts, |
| | | AccumulatedReceipts = accumulatedReceipts.HasValue? accumulatedReceipts.Value:0, |
| | | AccumulatedIncome = accumulatedIncome, |
| | | ReceiptsYesterday = receiptsYesterday, |
| | | AccumulatedOrders = accumulatedOrders, |