续费新开 已删除帐号处理

This commit is contained in:
wanyongkang
2020-12-07 09:10:58 +08:00
parent f433566143
commit de8a9a493a
2 changed files with 6 additions and 2 deletions

View File

@@ -72,7 +72,7 @@ namespace Hncore.Pass.Vpn.Service
public async Task<ProductAccountEntity> GetAccountInfo(string accout, int userId) public async Task<ProductAccountEntity> GetAccountInfo(string accout, int userId)
{ {
return await this.Query(true).FirstOrDefaultAsync(m => m.Account == accout && m.UserId == userId); return await this.Query(true).FirstOrDefaultAsync(m => m.Account == accout && m.UserId == userId && m.DeleteTag == 0);
} }
public async Task<List<ProductAccountEntity>> GetAccounts(string accouts,int userId=0) public async Task<List<ProductAccountEntity>> GetAccounts(string accouts,int userId=0)

View File

@@ -579,7 +579,7 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
} }
else if (order.OrderType == OrderType.AgainBuy || order.OrderType == OrderType.AgainBuys) else if (order.OrderType == OrderType.AgainBuy || order.OrderType == OrderType.AgainBuys)
{ {
var accountEntitys = await m_ProductAccountService.Query(p => p.UserId == order.UserId && p.ProductId == order.ProductId && accounts.Contains(p.Account)).ToListAsync(); var accountEntitys = await m_ProductAccountService.Query(p => p.UserId == order.UserId && p.DeleteTag == 0 && p.ProductId == order.ProductId && accounts.Contains(p.Account)).ToListAsync();
accountEntitys = accountEntitys.Distinct(new AccountEntityEq()).ToList(); accountEntitys = accountEntitys.Distinct(new AccountEntityEq()).ToList();
@@ -853,6 +853,10 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
{ {
var accountInfo = await m_ProductAccountService.GetAccountInfo(account, userId); var accountInfo = await m_ProductAccountService.GetAccountInfo(account, userId);
if(accountInfo.Status == AccountStatus.Refund){
return new ApiResult(ResultCode.C_Illegal_Operation, "此类帐号不允许退款");
}
if (accountInfo == null) if (accountInfo == null)
{ {
return new ApiResult(ResultCode.C_Illegal_Operation, "账户不存在"); return new ApiResult(ResultCode.C_Illegal_Operation, "账户不存在");