| | |
| | | } |
| | | |
| | | return receiptsListOutPut; |
| | | } |
| | | |
| | | public async Task<ChannlesRakeListOutPut> GetChannlesRakeList(List<string> channleList) |
| | | { |
| | | var today = DateTime.Now.Date; |
| | | var statistics = await _lifePayChannlesRakeRepository.Where(x => x.IsDeleted == false) |
| | | .WhereIf(channleList.Count() > 0, x => channleList.Contains(x.ChannelId)) |
| | | .ToListAsync(); |
| | | var groupedStatistics = statistics |
| | | .GroupBy(x => x.CreationTime) |
| | | .Select(g => new |
| | | { |
| | | CreationTime = g.Key, |
| | | ChannlesRakePrice = g.Sum(x => x.ChannlesRakePrice), |
| | | }) |
| | | .ToList(); |
| | | |
| | | |
| | | ChannlesRakeListOutPut channlesRakeListOutPut = new ChannlesRakeListOutPut(); |
| | | |
| | | foreach (var item in groupedStatistics) |
| | | { |
| | | ReceiptsDetail receive = new ReceiptsDetail() |
| | | { |
| | | CreationTime = item.CreationTime.ToString("yyyy-MM-dd"), |
| | | Amount = item.ChannlesRakePrice |
| | | }; |
| | | |
| | | channlesRakeListOutPut.ChannlesRakeList.Add(receive); |
| | | } |
| | | |
| | | return channlesRakeListOutPut; |
| | | |
| | | } |
| | | |
| | |
| | | { |
| | | ChannelDataReceive receive = new ChannelDataReceive() |
| | | { |
| | | ChannelId = item.ChannelId, |
| | | ChannelName = _lifePayChannlesRep.Where(x => x.ChannlesNum == item.ChannelId).FirstOrDefault().ChannlesName, |
| | | ReceivePrice = item.ReceivePrice, |
| | | ChannlesRakePrice = item.ChannlesRakePrice, |
| | | }; |
| | |
| | | { |
| | | ChannelDataUserNumber usernumber = new ChannelDataUserNumber() |
| | | { |
| | | ChannelId = item.ChannelId, |
| | | ChannelName = _lifePayChannlesRep.Where(x => x.ChannlesNum == item.ChannelId).FirstOrDefault().ChannlesName, |
| | | Number = item.Number, |
| | | }; |
| | | if (channelDataList.UserNumberList.Count() < 5) |
| | |
| | | YesterdayFail = yesterdayFail, |
| | | AccumulatedUsers = accumulatedUsers, |
| | | YesterdayActiveUsers = yesterdayActiveUsers, |
| | | ChannelId = channleId |
| | | ChannelId = channleId, |
| | | Date = today.AddDays(-1) |
| | | }; |
| | | await _dallyStatisticsRepository.InsertAsync(entity); |
| | | return entity; |