예제 #1
0
        public WithdrawApplyLogsResponse WithdrawApplyLogs()
        {
            var currentAccount = _contextService.GetCurrentAccount(HttpContext.Current);

            //通过以上方法 已经获取_wallet实例了
            var withdrawApplylogs = _walletQueryService.WithdrawApplyLogs(currentAccount.WalletId.ToGuid());

            return(new WithdrawApplyLogsResponse
            {
                WithdrawApplys = withdrawApplylogs.Select(x => new WithdrawApply
                {
                    Id = x.Id,
                    Mobile = x.Mobile,
                    NickName = x.NickName,
                    Amount = x.Amount,
                    BankName = x.BankName,
                    BankNumber = x.BankNumber,
                    BankOwner = x.BankOwner,
                    CreatedOn = x.CreatedOn,
                    Remark = x.Remark,
                    Status = x.Status.ToDescription(),
                    WalletId = x.WalletId
                }).ToList()
            });
        }
예제 #2
0
        public WithdrawApplysListPageResponse WithdrawApplysListPage([FromBody] WithdrawApplysListPageRequest request)
        {
            request.CheckNotNull(nameof(request));

            var pageSize          = 20;
            var withdrawApplylogs = _walletQueryService.WithdrawApplyLogs();
            var total             = withdrawApplylogs.Count();

            //筛选
            if (request.Status != WithdrawApplyStatus.All)
            {
                withdrawApplylogs = withdrawApplylogs.Where(x => x.Status == request.Status);
            }
            if (!request.Name.IsNullOrEmpty())
            {
                withdrawApplylogs = withdrawApplylogs.Where(x => x.BankOwner.Contains(request.Name));
                total             = withdrawApplylogs.Count();
            }
            total = withdrawApplylogs.Count();
            //分页
            withdrawApplylogs = withdrawApplylogs.OrderByDescending(x => x.CreatedOn).Skip(pageSize * (request.Page - 1)).Take(pageSize);

            return(new WithdrawApplysListPageResponse
            {
                Total = total,
                WithdrawApplys = withdrawApplylogs.Select(x => new WithdrawApply
                {
                    Id = x.Id,
                    Mobile = x.Mobile,
                    NickName = x.NickName,
                    Amount = x.Amount,
                    BankName = x.BankName,
                    BankNumber = x.BankNumber,
                    BankOwner = x.BankOwner,
                    CreatedOn = x.CreatedOn,
                    Remark = x.Remark,
                    Status = x.Status.ToDescription(),
                    WalletId = x.WalletId
                }).ToList()
            });
        }