diff --git a/GDZZ.Application/Service/WXPay/Dto/RechargeOut.cs b/GDZZ.Application/Service/WXPay/Dto/RechargeOut.cs new file mode 100644 index 0000000..2405a57 --- /dev/null +++ b/GDZZ.Application/Service/WXPay/Dto/RechargeOut.cs @@ -0,0 +1,28 @@ +using GDZZ.Core.Entity; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GDZZ.Application.Service.WXPay.Dto +{ + public class RechargeOut: DEntityBase + { + /// + /// 总价格 + /// + public decimal TotalPrice { get; set; } + /// + /// 支付金额 + /// + public decimal PaymentMoney { get; set; } + /// + /// 充值状态 + /// + public int Status { get; set; } + + + + } +} diff --git a/GDZZ.Application/Service/WXPay/WXPayService.cs b/GDZZ.Application/Service/WXPay/WXPayService.cs index 14d7aa7..ffc9102 100644 --- a/GDZZ.Application/Service/WXPay/WXPayService.cs +++ b/GDZZ.Application/Service/WXPay/WXPayService.cs @@ -20,6 +20,8 @@ using System.IO; using System.Text; using Senparc.Weixin.Exceptions; using Microsoft.AspNetCore.Authorization; +using System.Collections.Generic; +using Mapster; namespace GDZZ.Application.Service.WXPay { @@ -33,7 +35,7 @@ namespace GDZZ.Application.Service.WXPay private readonly SqlSugarRepository _sysUserRep; // 用户表仓储 private readonly SqlSugarRepository _sysTenantRep; //租户仓储 private readonly SqlSugarRepository self; //职业仓储 - private readonly SqlSugarRepository balance; //职业仓储 + private readonly SqlSugarRepository balance; //余额仓储 private readonly SqlSugarRepository rechargeRep; //充值仓储 private readonly SqlSugarRepository payTakeRep; //支付仓储 @@ -85,7 +87,7 @@ namespace GDZZ.Application.Service.WXPay [Route("Mini/v1/GetUserBalance")] public async Task GetUserBalance() { - var balan = await this.balance.SingleAsync(x => x.UserID == UserManager.UserId); + var balan = await this.balance.AsQueryable().Filter("TenantId", true).SingleAsync(x => x.UserID == UserManager.UserId); if (balan == null) return null; @@ -96,6 +98,18 @@ namespace GDZZ.Application.Service.WXPay }; } + /// + /// 充值记录查询 + /// + /// + [HttpGet] + [Route("Mini/v1/GetRechargeList")] + public async Task> GetRechargeList() + { + var rechargeLiist = this.rechargeRep.Where(x => x.CreatedUserId == UserManager.UserId).ToListAsync(); + return rechargeLiist.Adapt>(); + + }