示例#1
0
        /// <summary>
        /// 获取提现记录(忽略分页)
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public static List <DistributionWithdraw> GetWithdrawsAll(DistributionWithdrawQuery query)
        {
            var data    = Service.GetWithdrawsAll(query);
            var list    = data.Map <List <DistributionWithdraw> >();
            var members = GetService <IMemberService>().GetMembers(list.Select(p => p.MemberId).ToList());

            list.ForEach(item =>
            {
                item.Member = members.FirstOrDefault(p => p.Id == item.MemberId);
            });

            return(list);
        }
        public ActionResult Withdraws(DistributionWithdrawQuery query)
        {
            query.MemberId = CurrentUser.Id;
            var data = DistributionApplication.GetWithdraws(query);
            var list = data.Models.Select(p => new
            {
                p.Amount,
                Id             = p.Id.ToString(),
                Time           = p.ApplyTime,
                WithdrawType   = p.WithdrawType.ToDescription(),
                Status         = p.WithdrawStatus,
                WithdrawStatus = p.WithdrawStatus.ToDescription()
            });

            return(Json(new { success = true, list }, true));
        }
示例#3
0
        /// <summary>
        /// 获取提现记录
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public static QueryPageModel <DistributionWithdraw> GetWithdraws(DistributionWithdrawQuery query)
        {
            var data    = Service.GetWithdraws(query);
            var list    = data.Models.Map <List <DistributionWithdraw> >();
            var members = GetService <IMemberService>().GetMembers(list.Select(p => p.MemberId).ToList());

            list.ForEach(item =>
            {
                item.Member = members.FirstOrDefault(p => p.Id == item.MemberId);
            });

            return(new QueryPageModel <DistributionWithdraw>
            {
                Models = list,
                Total = data.Total
            });
        }
        /// <summary>
        /// 获取提现记录
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageNo"></param>
        /// <returns></returns>
        public JsonResult <Result <dynamic> > GetWithdraws(int pageSize, int pageNo)
        {
            CheckUserLogin();
            DistributionWithdrawQuery query = new DistributionWithdrawQuery();

            query.PageSize = pageSize;
            query.PageNo   = pageNo;
            query.MemberId = CurrentUser.Id;
            var data = DistributionApplication.GetWithdraws(query);
            var list = data.Models.Select(p => new
            {
                p.Amount,
                Id             = p.Id.ToString(),
                Time           = p.ApplyTime.ToString("yyyy-MM-dd HH:mm:ss"),
                WithdrawType   = p.WithdrawType.ToDescription(),
                Status         = p.WithdrawStatus,
                WithdrawStatus = p.WithdrawStatus.ToDescription()
            });

            return(JsonResult <dynamic>(new { rows = list, total = data.Total }));
        }
        public ActionResult WithdrawList(DistributionWithdrawQuery query)
        {
            var data = DistributionApplication.GetWithdraws(query);
            var list = data.Models.Select(p => new
            {
                p.Amount,
                Id          = p.Id.ToString(),
                Time        = p.ApplyTime.ToString("yyyy-MM-dd HH:mm:ss"),
                ConfirmTime = p.ConfirmTime?.ToString("yyyy-MM-dd HH:mm:ss") ?? string.Empty,
                PayTime     = p.PayTime?.ToString("yyyy-MM-dd HH:mm:ss") ?? string.Empty,
                p.PayNo,
                MemberName   = p.Member.UserName,
                WithdrawType = p.WithdrawType.ToDescription(),
                Status       = p.WithdrawStatus,
                p.WithdrawAccount,
                p.WithdrawName,
                WithdrawStatus = p.WithdrawStatus.ToDescription(),
                p.Remark
            });

            return(Json(new { rows = list, total = data.Total }, true));
        }
        /// <summary>
        /// 导出佣金提现记录
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public ActionResult DetailsExportToExcel(DistributionWithdrawQuery query)
        {
            var result = DistributionApplication.GetWithdrawsAll(query);

            return(ExcelView("DetailsExport", "平台佣金提现记录", result));
        }