public UserQueryInfo QueryUserByUserName(string userName, string agentId) { var userManager = new UserBalanceManager(); var reg = userManager.QueryUserRegisterByUserName(userName); if (reg == null) { throw new Exception("用户不存在"); } if (string.IsNullOrEmpty(reg.AgentId) || reg.AgentId != agentId) { throw new Exception(string.Format("用户{0}不属于您发展的用户", userName)); } var balance = userManager.QueryUserBalance(reg.UserId); if (balance == null) { throw new Exception("用户账户不存在"); } var realNameManager = new UserRealNameManager(); var real = realNameManager.GetUserRealName(reg.UserId); var mobileManagr = new UserMobileManager(); var mobile = mobileManagr.GetUserMobile(reg.UserId); var fundManger = new FundManager(); var agentFreezeBalance = fundManger.QueryAgentFreezeBalanceByUserId(reg.UserId); var caibbFreezeBalance = 0M; if (balance.FreezeBalance > 0) { caibbFreezeBalance = balance.FreezeBalance - agentFreezeBalance;//网站冻结资金=总冻结资金-代理冻结资金; } return(new UserQueryInfo { DisplayName = reg.DisplayName, UserId = reg.UserId, RealName = real == null ? string.Empty : real.RealName, IdCardNumber = real == null ? string.Empty : real.IdCardNumber, Mobile = mobile == null ? string.Empty : mobile.Mobile, FillMoneyBalance = balance.FillMoneyBalance, BonusBalance = balance.BonusBalance, CommissionBalance = balance.CommissionBalance, ExpertsBalance = balance.ExpertsBalance, RedBagBalance = balance.RedBagBalance, FreezeBalance = caibbFreezeBalance, IsEnable = reg.IsEnable, AgentId = reg.AgentId, IsAgent = reg.IsAgent, CardType = "", ComeFrom = reg.ComeFrom, Email = "", IsFillMoney = reg.IsFillMoney, IsSettedEmail = true, IsSettedMobile = mobile == null ? false : mobile.IsSettedMobile, IsSettedRealName = real == null ? false : real.IsSettedRealName, RegisterIp = reg.RegisterIp, RegTime = reg.CreateTime, VipLevel = reg.VipLevel, CurrentDouDou = balance.CurrentDouDou, }); }
public UserQueryInfo QueryUserByKey(string userId, string agentId) { var userManager = new UserBalanceManager(); var reg = userManager.QueryUserRegister(userId); if (reg == null) { throw new Exception("用户不存在"); } if (!string.IsNullOrEmpty(agentId) && reg.AgentId != agentId) { throw new Exception(string.Format("用户{0}不属于您发展的用户", userId)); } var balance = userManager.QueryUserBalance(userId); if (balance == null) { throw new Exception("用户账户不存在"); } var realNameManager = new UserRealNameManager(); var real = realNameManager.GetUserRealName(userId); //var apliy = new AlipayLoginInfo(); //var apliyCount = apliy.ApliyCount; var mobileManagr = new UserMobileManager(); var mobile = mobileManagr.GetUserMobile(userId); var fundManger = new FundManager(); var agentFreezeBalance = fundManger.QueryAgentFreezeBalanceByUserId(userId); var caibbFreezeBalance = 0M; if (balance.FreezeBalance > 0) { caibbFreezeBalance = balance.FreezeBalance - agentFreezeBalance;//网站冻结资金=总冻结资金-代理冻结资金; } var userAlipayManager = new UserAlipayManager(); var userAlipy = userAlipayManager.GetUserAlipay(userId); var userQQManager = new UserQQManager(); var userQQ = userQQManager.GetUserQQ(userId); var ocAgentManager = new OCAgentManager(); var ocAgent = ocAgentManager.QueryOCAgent(userId); return(new UserQueryInfo { DisplayName = reg.DisplayName, UserId = reg.UserId, RealName = real == null ? string.Empty : real.RealName, IdCardNumber = real == null ? string.Empty : real.IdCardNumber, Mobile = mobile == null ? string.Empty : mobile.Mobile, FillMoneyBalance = balance.FillMoneyBalance, BonusBalance = balance.BonusBalance, CommissionBalance = balance.CommissionBalance, ExpertsBalance = balance.ExpertsBalance, RedBagBalance = balance.RedBagBalance, FreezeBalance = caibbFreezeBalance, IsEnable = reg.IsEnable, AgentId = reg.AgentId, IsAgent = reg.IsAgent, CardType = "", ComeFrom = reg.ComeFrom, Email = "", IsFillMoney = reg.IsFillMoney, IsSettedEmail = true, IsSettedMobile = mobile == null ? false : mobile.IsSettedMobile, IsSettedRealName = real == null ? false : real.IsSettedRealName, RegisterIp = reg.RegisterIp, RegTime = reg.CreateTime, VipLevel = reg.VipLevel, CurrentDouDou = balance.CurrentDouDou, ApliyCount = userAlipy == null ? string.Empty : userAlipy.AlipayAccount, QQNumber = userQQ == null ? string.Empty : userQQ.QQ, CPSMode = ocAgent == null ? 0 : ocAgent.CPSMode, UserGrowth = balance.UserGrowth, CPSBalance = balance.CPSBalance }); }