Пример #1
0
        public ActionResult List(DataSourceRequest command, ApplyCashListModel model)
        {
            var cashs = _cashService.GetAllApplyCashs(
                audit: model.AuditId,
                createdFrom: model.StartDate,
                createdTo: model.EndDate,
                pageIndex: command.Page,
                pageSize: command.PageSize);

            var jsonData = new DataSourceResult
            {
                Data = cashs.Items.Select(b => new
                {
                    Id           = b.Id,
                    Audit        = ((AuditStatus)b.Audit).GetDescription(),
                    Amount       = b.Amount,
                    Allowance    = b.Allowance,
                    CreationTime = b.CreationTime.ToString("yyyy/mm/dd"),
                    NickName     = GetCustomerInfo(b.CustomerId).NickName,
                    Mobile       = GetCustomerInfo(b.CustomerId).Mobile
                }),
            };

            return(AbpJson(jsonData));
        }
Пример #2
0
        public ActionResult Earnings()
        {
            var model      = new EarningModel();
            var customer   = _customerService.GetCustomerId(this.CustomerId);
            var commission = customer.GetCustomerAttributeValue <decimal>(CustomerAttributeNames.Commission);

            model.CustomerId = customer.Id;
            model.Commission = commission;

            var dateStart = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
            var dateEnd   = DateTime.Now.AddMonths(1).AddDays(-1);
            var applies   = _applyCashService.GetAllApplyCashs(createdFrom: dateStart, createdTo: dateEnd, customerId: this.CustomerId, audit: (int)AuditStatus.Audited);

            model.CurrentWithdrawalAmount = applies.Items.Sum(a => a.Amount);
            model.CurrentWithdrawals      = applies.TotalCount;

            var comms = _commissionServicer.GetAllCommissions(customerId: this.CustomerId, createdFrom: dateStart, createdTo: dateEnd);

            model.CurrentCommissionCount  = comms.TotalCount;
            model.CurrentCommissionAmount = comms.Items.Sum(c => c.ReturnAmount);
            return(View(model));
        }