未实名购买测试 兼容IE
This commit is contained in:
@@ -91,8 +91,8 @@
|
|||||||
<div class="item cishu">
|
<div class="item cishu">
|
||||||
剩余试用次数<span style="color:red">@(Model.RestTimes)</span>
|
剩余试用次数<span style="color:red">@(Model.RestTimes)</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="item tip">
|
<div style="text-align: center;">
|
||||||
|
<a href='http://www.juip.com/User/Index' class="item tip"></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="item tijiao lingqu">
|
<div class="item tijiao lingqu">
|
||||||
@if (Model.RestTimes > 0 && Model.Package.Status == 1)
|
@if (Model.RestTimes > 0 && Model.Package.Status == 1)
|
||||||
|
|||||||
@@ -272,10 +272,17 @@ namespace Hncore.Pass.Vpn.Controllers
|
|||||||
}
|
}
|
||||||
var restTimes = await m_AccountService.GetRestTestCount(userId);
|
var restTimes = await m_AccountService.GetRestTestCount(userId);
|
||||||
|
|
||||||
|
var is_verify = await m_AccountService.GetUserStatus(userId);
|
||||||
|
|
||||||
if (restTimes <= 0)
|
if (restTimes <= 0)
|
||||||
{
|
{
|
||||||
return Error("没有测试次数了");
|
return Error("没有测试次数了");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_verify == 0)
|
||||||
|
{
|
||||||
|
return Error("请点击前往实名认证");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var ret= await m_agentService.NewAccount(0, request.PackageId, request.Account, request.Pwd, accountType: 0);
|
var ret= await m_agentService.NewAccount(0, request.PackageId, request.Account, request.Pwd, accountType: 0);
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ namespace Hncore.Pass.Vpn.Domain
|
|||||||
|
|
||||||
public int? ManagerId { get; set; } = 0;
|
public int? ManagerId { get; set; } = 0;
|
||||||
public string ManagerName { get; set; }
|
public string ManagerName { get; set; }
|
||||||
|
public int is_verify { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -167,5 +167,12 @@ namespace Hncore.Pass.Vpn.Service
|
|||||||
restTimes = restTimes < 0 ? 0 : restTimes;
|
restTimes = restTimes < 0 ? 0 : restTimes;
|
||||||
return restTimes;
|
return restTimes;
|
||||||
}
|
}
|
||||||
|
//获取是否实名认证
|
||||||
|
public async Task<int> GetUserStatus(int userId)
|
||||||
|
{
|
||||||
|
var userInfo = await m_UserService.GetById(userId);
|
||||||
|
var flag = userInfo.is_verify;
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,6 +201,7 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
|||||||
|
|
||||||
public async Task<ApiResult<ProductOrderEntity>> CreateOrder(CreateOrderRequest request, int userId)
|
public async Task<ApiResult<ProductOrderEntity>> CreateOrder(CreateOrderRequest request, int userId)
|
||||||
{
|
{
|
||||||
|
|
||||||
var packageEntity = await m_ProductPackageService.GetById(request.PackageId);
|
var packageEntity = await m_ProductPackageService.GetById(request.PackageId);
|
||||||
if (packageEntity == null)
|
if (packageEntity == null)
|
||||||
{
|
{
|
||||||
@@ -217,6 +218,14 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
|||||||
}
|
}
|
||||||
|
|
||||||
var userEntity = await m_UserService.GetById(userId);
|
var userEntity = await m_UserService.GetById(userId);
|
||||||
|
|
||||||
|
var is_verify = userEntity.is_verify;
|
||||||
|
|
||||||
|
if (is_verify == 0)
|
||||||
|
{
|
||||||
|
return new ApiResult<ProductOrderEntity>(ResultCode.C_INVALID_ERROR, "请前往实名认证");
|
||||||
|
}
|
||||||
|
|
||||||
var price = packageEntity.Price;
|
var price = packageEntity.Price;
|
||||||
var userPrice = await this.m_ProductUserPriceService.Query(true).FirstOrDefaultAsync(m => m.UserId == userId && m.PackageId == packageEntity.Id && m.Status == 1);
|
var userPrice = await this.m_ProductUserPriceService.Query(true).FirstOrDefaultAsync(m => m.UserId == userId && m.PackageId == packageEntity.Id && m.Status == 1);
|
||||||
if (userPrice != null && userPrice.UserPrice > 0)
|
if (userPrice != null && userPrice.UserPrice > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user