public void AddTodayUserStatistics(DateTime date) { var footUserStatistics = _UserManager.GetFootUserStatistics(date); //用户总数、用户每日新增、认证人数(通过)、当天认证通过数、当天认证不通过数 var userServiceStateStatistics = _UserServiceStateManager.GetUserServiceStateStatistics(date); //vip试用用户(在试用期未付费用户)、付费用户总数(在服务期内的付费用户) var todayPaidUserCount = _TradeManager.GetTheDayPaidUserCount(date); //当天付费用户新增数 //添加数据 var args = new AddUserStatisticsArgs(); args.date = date; //时间 int officialUserCount = userServiceStateStatistics.officialUserCount; //付费用户总数(在服务期内的付费用户) int totalCount = footUserStatistics.totalCount; //用户总数 args.totalCount = totalCount; //用户总数 args.todayCreatedCount = footUserStatistics.todayCreatedCount; //用户每日新增 args.verifiedCount = footUserStatistics.verifiedCount; //认证人数(通过) args.todayPassCount = footUserStatistics.todayPassCount; //当天认证通过数 args.todayUnPassCount = footUserStatistics.todayUnPassCount; //当天认证不通过数 args.trailUserCount = userServiceStateStatistics.trailUserCount; //vip试用用户(在试用期未付费用户) args.officialUserCount = officialUserCount; //付费用户总数(在服务期内的付费用户) args.todayPaidUserCount = todayPaidUserCount; //当天付费用户新增数 if (totalCount == 0) { args.paidRate = 0; } else { //付费率=付费用户/总用户 var rate = (decimal)officialUserCount / totalCount; args.paidRate = Math.Round(rate, 4);//保留4位小数 } _UserStatisticsManager.Add(args); }