/// <summary> /// 查询提现记录的列表 /// </summary> /// <param name="cash_type">金钻还是银钻</param> /// <param name="cash_status">状态</param> /// <param name="beginTime">开始时间</param> /// <param name="endTime">结束时间</param> /// <param name="page">页码</param> /// <param name="rows">条数</param> /// <returns></returns> public ActionResult SelectCashRecordList(int?cash_type, int?cash_status, DateTime?beginTime, DateTime?endTime, int page = 1, int rows = 20) { var userId = int.Parse(User.Identity.Name); var pageData = this.userManager.GetCashRequests(userId, null, null, cash_type, cash_status, beginTime, endTime, page, rows); var data = pageData.Select(c => new { user_id = c.user_id, cash_type = CashType.ToString(c.cash_type), cash_money = c.cash_money, cash_status = CashStatus.ToString(c.cash_status), cash_time1 = c.cash_time1.ToString("yyyy-MM-dd HH:mm:ss"), cash_record_id = c.cash_record_id }); var total = this.userManager.GetCashRequestsTotal(userId, null, null, cash_type, cash_status, beginTime, endTime); return(Json(new { total = total, rows = data })); }
/// <summary> /// 查询代币全部提现记录 /// </summary> public ActionResult BlueCashRecordAll(string user_code, string user_phone, int?cash_status, DateTime?begin, DateTime?end, int page = 1, int rows = 10) { if (Request.IsAjaxRequest()) { var pageData = this._userManager.BlueGetCashRequests(null, user_code, user_phone, CashType.BLUE_DIAMOND, cash_status, begin, end, page, rows); var data = pageData.Select(c => new { user_code = c.user.user_code, wallet_adder = c.user.wallet_adder, cash_type = CashType.ToString(c.cash_type), cash_money = c.cash_money, cash_status = CashStatus.ToString(c.cash_status), cash_time1 = c.cash_time1.ToString("yyyy-MM-dd HH:mm:ss"), cash_record_id = c.cash_record_id, user_id = c.user_id }); var total = this._userManager.BlueGetCashRequestsTotal(null, user_code, user_phone, CashType.BLUE_DIAMOND, cash_status, begin, end); return(Json(new { total = total, rows = data })); } return(View()); }
/// <summary> /// 查询全部提现记录 /// </summary> /// <param name="user_name"></param> /// <param name="user_phone"></param> /// <param name="cash_type"></param> /// <param name="cash_status"></param> /// <param name="begin"></param> /// <param name="end"></param> /// <param name="page"></param> /// <param name="rows"></param> /// <returns></returns> public ActionResult CashRecordAll(string user_name, string user_phone, int?cash_type, int?cash_status, DateTime?begin, DateTime?end, int page = 1, int rows = 10) { if (Request.IsAjaxRequest()) { var pageData = this._userManager.GetCashRequests(null, user_name, user_phone, cash_type, cash_status, begin, end, page, rows); var data = pageData.Select(c => new { user_name = c.user.user_name, user_phone = c.user.user_phone, user_code = c.user.user_code, cash_type = CashType.ToString(c.cash_type), cash_money = c.cash_money, shouxu_money = Convert.ToInt32(c.cash_money * CashRate.SHOU_XU_FEI), cash_status = CashStatus.ToString(c.cash_status), cash_time1 = c.cash_time1.ToString("yyyy-MM-dd HH:mm:ss"), cash_record_id = c.cash_record_id, user_id = c.user_id }); var total = this._userManager.GetCashRequestsTotal(null, user_name, user_phone, cash_type, cash_status, begin, end); return(Json(new { total = total, rows = data })); } return(View()); }
public ActionResult AuditCashRequest(FormCollection form) { var cashRecordId = form["cash_record_id"]; if (string.IsNullOrEmpty(cashRecordId)) { return(Json(new AjaxResultObject { code = AjaxResultObject.ERROR, message = "数据校验错误" })); } int cashId = int.Parse(cashRecordId); //获取对象 cash_record cashRecord = this._userManager.GetCashRecord(cashId); var operId = (Session[SessionConstants.CURRENTOPERATOR] as _operator).oper_id; if (cashRecordId == null) { return(Json(new AjaxResultObject { code = AjaxResultObject.ERROR, message = "数据校验错误" })); } cashRecord.oper_id1 = operId; //判断是通过审核还是不通过审核 var cash_status = form["cash_status"]; //如果不通过 if (cash_status.Equals(CashStatus.AUDIT_DENY)) { cashRecord.cash_status = CashStatus.AUDIT_DENY; cashRecord.cash_time2 = DateTime.Now; cashRecord.cash_remark1 = form["cash_remark1"]; this._userManager.UpdateCashRecord(cashRecord); return(Json(new AjaxResultObject { code = AjaxResultObject.OK, message = "审核成功", data = cashRecord })); } //如果是通过的 var userAccount = this._userManager.GetUserAccount(cashRecord.user_id);//查会员账户 int cash_money = cashRecord.cash_money; int shou_xu_fei = Convert.ToInt32(cash_money * CashRate.SHOU_XU_FEI); //int fu_xiao_fei = Convert.ToInt32(cash_money * CashRate.FU_XIAO_FEI); //判断是否需要的金额,大于了所剩余额 if (cashRecord.cash_type == CashType.GOLD_DIAMOND) //金钻账户 { if (userAccount.account1_balance < (cash_money + shou_xu_fei)) { cashRecord.cash_status = CashStatus.AUDIT_DENY; cashRecord.cash_time2 = DateTime.Now; cashRecord.cash_remark1 = "审核不成功,该账户余额不足以支付提现扣除"; this._userManager.UpdateCashRecord(cashRecord); return(Json(new AjaxResultObject { code = AjaxResultObject.ERROR, message = "审核不成功,该账户余额不足以支付提现扣除" })); } } if (cashRecord.cash_type == CashType.SILVER_DIAMOND) //银钻账户 { if (userAccount.account2_balance < (cash_money + shou_xu_fei)) { cashRecord.cash_status = CashStatus.AUDIT_DENY; cashRecord.cash_time2 = DateTime.Now; cashRecord.cash_remark1 = "审核不成功,该账户余额不足以支付提现扣除"; this._userManager.UpdateCashRecord(cashRecord); return(Json(new AjaxResultObject { code = AjaxResultObject.ERROR, message = "审核不成功,该账户余额不足以支付提现扣除" })); } } if (cashRecord.cash_type == CashType.BLUE_DIAMOND) //代币提现 { if (userAccount.account3_balance < (cash_money + shou_xu_fei)) { cashRecord.cash_status = CashStatus.AUDIT_DENY; cashRecord.cash_time2 = DateTime.Now; cashRecord.cash_remark1 = "审核不成功,该账户余额不足以支付提现扣除"; this._userManager.UpdateCashRecord(cashRecord); return(Json(new AjaxResultObject { code = AjaxResultObject.ERROR, message = "审核不成功,该账户余额不足以支付提现扣除" })); } } cashRecord.cash_remark1 = form["cash_remark1"]; cash_record mm = this._userManager.AuidCashRecord(cashRecord); if (mm.cash_status == CashStatus.GIVEMONEY_WAITING) { var c = mm; return(Json(new AjaxResultObject { code = AjaxResultObject.OK, message = "审核成功", data = new { user_name = c.user.user_name, user_phone = c.user.user_phone, cash_type = CashType.ToString(c.cash_type), cash_money = c.cash_money, shouxu_money = Convert.ToInt32(c.cash_money * CashRate.SHOU_XU_FEI), //fuxiao_money = Convert.ToInt32(c.cash_money * CashRate.FU_XIAO_FEI), //actual_money = c.cash_money - Convert.ToInt32(c.cash_money * CashRate.SHOU_XU_FEI) - Convert.ToInt32(c.cash_money * 1 /** CashRate.FU_XIAO_FEI*/), cash_status = CashStatus.ToString(c.cash_status), cash_time1 = c.cash_time1.ToString("yyyy-MM-dd HH:mm:ss"), cash_record_id = c.cash_record_id, user_id = c.user_id } })); } else { return(Json(new AjaxResultObject { code = AjaxResultObject.ERROR, message = "审核不成功" })); } }