public GetLotteryInfoResq GetLotteryInfo(GetLotteryInfoReq para) { ActivityInfoProcessing activityInfoProcessing = new ActivityInfoProcessing(); if (!activityInfoProcessing.ExistUId(para.Uid)) { activityInfoProcessing.InsertUserInfo(para.Uid, para.HeadUrl, para.NickName); } GetLotteryInfoResq getLotteryInfoResq = new GetLotteryInfoResq(); getLotteryInfoResq.AvailableCount = 2 - activityInfoProcessing.GetTodayLotteryCount(para); getLotteryInfoResq.userInfo = activityInfoProcessing.GetUserInfoModel(para); getLotteryInfoResq.userBoxIndex = activityInfoProcessing.GetUserBoxInfos(para).Select(m => m.F_BoxIndex).ToArray(); List <UserLotteryCount> userLotteryDetails = activityInfoProcessing.GetUserLotteryCount(para); List <UserLotteryHelp> userLotteryHelps = activityInfoProcessing.GetUserLotteryHelp(para); List <UserLotteryDetail> details = new List <UserLotteryDetail>(); foreach (UserLotteryCount item in userLotteryDetails) { var userHelp = userLotteryHelps.Where(m => m.F_LotteryIndex == item.F_LotteryIndex).OrderByDescending(m => m.F_CreateTime).FirstOrDefault(); if (userHelp != null) { UserLotteryDetail detail = new UserLotteryDetail(); detail.F_LotteryCount = item.F_IndexCount; detail.F_LotteryIndex = item.F_LotteryIndex; detail.F_UId = item.F_UId; detail.F_CreateUId = userHelp.F_CreateUId; detail.F_CreateNickName = userHelp.F_CreateNickName; detail.F_CreateHeadUrl = userHelp.F_CreateHeadUrl; details.Add(detail); } } getLotteryInfoResq.userLottery = details; return(getLotteryInfoResq); }
/// <summary> /// 获取用户信息 /// </summary> /// <param name="para"></param> /// <returns></returns> public UserInfoModel GetUserInfo(GetLotteryInfoReq para) { ActivityInfoProcessing activityInfoProcessing = new ActivityInfoProcessing(); return(activityInfoProcessing.GetUserInfoModel(para)); }