diff --git a/Host/Controllers/UserController.cs b/Host/Controllers/UserController.cs index 575495d..ad62581 100644 --- a/Host/Controllers/UserController.cs +++ b/Host/Controllers/UserController.cs @@ -516,11 +516,15 @@ namespace Home.Controllers if (request.ExpiredDay > -100) { if (request.ExpiredDay > 0){ - exp = exp.And(m => Math.Ceiling((m.EndTime - DateTime.Now).Value.TotalDays) <= request.ExpiredDay && Math.Ceiling((m.EndTime - DateTime.Now).Value.TotalDays) >=0); - } else if (request.ExpiredDay < 0 && request.ExpiredDay!=-4) { - exp = exp.And(m => Math.Ceiling((m.EndTime - DateTime.Now).Value.TotalDays) >= request.ExpiredDay && Math.Ceiling((m.EndTime - DateTime.Now).Value.TotalDays) <=0); - } else { + exp = exp.And(m => Math.Ceiling((m.EndTime - DateTime.Now).Value.TotalDays) <= request.ExpiredDay && m.EndTime > DateTime.Now); + } else if (request.ExpiredDay < 0 && request.ExpiredDay>-4) { + exp = exp.And(m => Math.Ceiling((DateTime.Now - m.EndTime).Value.TotalDays) <= Math.Abs(request.ExpiredDay) && m.EndTime < DateTime.Now); + } else if (request.ExpiredDay==-4) { exp = exp.And(m => Math.Ceiling((m.EndTime - DateTime.Now).Value.TotalDays) <= -4); + } else if (request.ExpiredDay==-5) { + exp = exp.And(m => m.EndTime > DateTime.Now); + } else if (request.ExpiredDay==-6) { + exp = exp.And(m => m.EndTime < DateTime.Now); } } diff --git a/Host/Models/AccountSearchModel.cs b/Host/Models/AccountSearchModel.cs index 9f5cbab..5af6d4e 100644 --- a/Host/Models/AccountSearchModel.cs +++ b/Host/Models/AccountSearchModel.cs @@ -8,7 +8,7 @@ namespace Home.Models { public DateTime? BTime { get; set; } public DateTime? ETime { get; set; } - public int? ExpiredDay { get; set; } = -100;//OrderType + public int ExpiredDay { get; set; } = -100;//OrderType public int ProductId { get; set; } = 0; public string PackageId { get; set; } = "0"; diff --git a/Host/Views.Mobile/User/MyAccounts.cshtml b/Host/Views.Mobile/User/MyAccounts.cshtml index c11b77f..26abe3e 100644 --- a/Host/Views.Mobile/User/MyAccounts.cshtml +++ b/Host/Views.Mobile/User/MyAccounts.cshtml @@ -54,6 +54,8 @@ + +
diff --git a/Host/Views/User/MyAccounts.cshtml b/Host/Views/User/MyAccounts.cshtml index ca05899..ebe3a83 100644 --- a/Host/Views/User/MyAccounts.cshtml +++ b/Host/Views/User/MyAccounts.cshtml @@ -311,6 +311,8 @@ + +
diff --git a/Services/Hncore.Pass.Vpn/Controllers/ProductAccountController.cs b/Services/Hncore.Pass.Vpn/Controllers/ProductAccountController.cs index d1c03a6..c82cf8c 100644 --- a/Services/Hncore.Pass.Vpn/Controllers/ProductAccountController.cs +++ b/Services/Hncore.Pass.Vpn/Controllers/ProductAccountController.cs @@ -152,19 +152,20 @@ namespace Hncore.Pass.Vpn.Controllers { expr = expr.And(m => m.StartTime>=request.BkTime&&m.StartTime<=request.EkTime); } - if (request.ExpirdDay > -1) + if (request.ExpirdDay > -100) { if (request.ExpirdDay == 0) { expr = expr.And(m => m.EndTime.Value < DateTime.Now); - } - else - { - var startTime = DateTime.Now.Begin().AddDays(request.ExpirdDay); - startTime = startTime < DateTime.Now ? DateTime.Now : startTime; - var EndTime = DateTime.Now.End().AddDays(request.ExpirdDay); - expr = expr.And(m => m.EndTime >= startTime && m.EndTime <= EndTime); - } + }else if(request.ExpirdDay == -2){ + expr = expr.And(m => m.EndTime.Value > DateTime.Now); + } else if (request.ExpirdDay < 0 && request.ExpirdDay>-4) { + expr = expr.And(m => Math.Ceiling((DateTime.Now - m.EndTime).Value.TotalDays) <= Math.Abs(request.ExpirdDay) && m.EndTime < DateTime.Now); + } else if (request.ExpirdDay==-4) { + expr = expr.And(m => Math.Ceiling((m.EndTime - DateTime.Now).Value.TotalDays) <= -4); + }else if (request.ExpirdDay > 0){ + expr = expr.And(m => Math.Ceiling((m.EndTime - DateTime.Now).Value.TotalDays) <= request.ExpirdDay && m.EndTime > DateTime.Now); + } // expr = expr.And(m => Math.Ceiling((m.EndTime - DateTime.Now).Value.TotalDays) == request.ExpirdDay); } var ret = await m_AccountService.PageDesc(request.PageIndex, request.PageSize, expr,true,m=>m.Id);