public UserController() { userLogic = new SysUserLogic(); userRoleRelationLogic = new SysUserRoleRelationLogic(); userLogOnLogic = new SysUserLogOnLogic(); userAnchorLogic = new SysUserAnchorLogic(); }
public ActionResult Form(SysAnchorWithdrawalRecordEntity model) { var agentModel = new SysUserAnchorLogic().GetAnchorBalance(model.AnchorID); if (agentModel == null) { return(Error("主播不存在!")); } if (agentModel.agentGold / 10 < model.WithdrawalAmount) { return(Error("提现金额不可大于余额!可提现余额:" + agentModel.agentGold / 10)); } int row = sysAnchorWithdrawalRecordLogic.Insert(agentModel, model); return(row > 0 ? Success() : Error()); }
public ActionResult Form(SysAnchorBankEntity model) { if (model.id == 0) { var agentModel = new SysUserAnchorLogic().CheckAnchorName(model.AgentName); if (agentModel == null) { return(Error("主播不存在!")); } model.AnchorID = agentModel.id; int row = sysAnchorBankLogic.Insert(model); return(row > 0 ? Success() : Error()); } else { int row = sysAnchorBankLogic.Update(model); return(row > 0 ? Success() : Error()); } }
public ActionResult Handle(SysAnchorWithdrawalRecordEntity model) { int row; var withModel = sysAnchorWithdrawalRecordLogic.Get(model.id); if (withModel.Status != 3) { return(Error("已经处理,不可重复处理!")); } var agentModel = new SysUserAnchorLogic().GetAnchorBalance(withModel.AnchorID); if (model.Status == 2) //驳回 { model.WithdrawalAmount = withModel.WithdrawalAmount; //返回提现金额 row = sysAnchorWithdrawalRecordLogic.Reject(model, agentModel); } else//成功 { row = sysAnchorWithdrawalRecordLogic.Update(model); } return(row > 0 ? Success() : Error()); }
public ActionResult Form(AddTipDetailModel model) { var anchorModel = new SysUserAnchorLogic().CheckAnchorName(model.anchorName); if (anchorModel == null) { return(Error("主播不存在!")); } var agentModel = new SysAnchorRebateLogic().GetRebateByAccount(anchorModel.id); var addModel = new SysTipIncomeDetailEntity { ShopID = 0, AnchorID = anchorModel.id, AnchorIncome = model.money, StartDate = DateTime.Now, UserID = agentModel == null ? null : agentModel.parentID, TipType = Entity.Enum.TipTypeEnum.其他, IncomeType = Entity.Enum.IncomeTypeEnum.手动添加, CreateTime = DateTime.Now }; var result = sysTipIncomeDetailLogic.AddTipIncome(addModel); return(result ? Success() : Error()); }
public UserAnchorController() { sysUserAnchorLogic = new SysUserAnchorLogic(); }