This commit is contained in:
@@ -188,6 +188,27 @@ namespace Hncore.Pass.Vpn.Controllers
|
||||
if (request.KeyWord.Has())
|
||||
{
|
||||
Expression<Func<ProductAccountEntity, bool>> expr = m => (m.Account== request.KeyWord||m.UserCode== request.KeyWord) && m.DeleteTag==0;
|
||||
if (request.ProductIds != null && request.ProductIds.Count > 0)
|
||||
{
|
||||
expr = expr.And(m =>request.ProductIds.Contains((int)m.ProductId));
|
||||
}
|
||||
if (request.ExpirdDay > -100)
|
||||
{
|
||||
if (request.ExpirdDay == 0)
|
||||
{
|
||||
expr = expr.And(m => m.EndTime.Value < DateTime.Now);
|
||||
}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 => m.PackageName != "测试卡");
|
||||
// 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);
|
||||
var data = ret.ToApiResult();
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user