From eb2d9c997a8761776b753fa02017142fb7a7cb00 Mon Sep 17 00:00:00 2001 From: jianweie code Date: Mon, 18 Nov 2024 21:48:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=AB=AF=E3=80=90=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E3=80=91=EF=BC=9A=E4=BF=AE=E5=A4=8D=E3=80=90=E6=88=91?= =?UTF-8?q?=E8=B4=AD=E4=B9=B0=E7=9A=84=E6=9C=8D=E5=8A=A1=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=8D=A1=E3=80=91=E9=87=8C=E9=9D=A2=E7=9A=84=E6=A0=B8=E9=94=80?= =?UTF-8?q?=E7=A0=81=E5=88=87=E6=8D=A2=E5=A4=B1=E6=95=88=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/UserController.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/CoreCms.Net.Web.WebApi/Controllers/UserController.cs b/CoreCms.Net.Web.WebApi/Controllers/UserController.cs index d6f86144..69fbc26e 100644 --- a/CoreCms.Net.Web.WebApi/Controllers/UserController.cs +++ b/CoreCms.Net.Web.WebApi/Controllers/UserController.cs @@ -2475,15 +2475,25 @@ namespace CoreCms.Net.Web.WebApi.Controllers where = where.And(p => p.serviceOrderId == entity.id); var dt = DateTime.Now; - if (service.validityType == 2 && status == (int)GlobalEnumVars.ServicesTicketStatus.过期) + //限制时间段的数据 + if (service.validityType == (int)GlobalEnumVars.ServicesValidityType.TimeFrame && status == (int)GlobalEnumVars.ServicesTicketStatus.过期) { - where = where.And(p => dt > p.validityEndTime); + where = where.And(p => dt > p.validityEndTime && p.status == (int)GlobalEnumVars.ServicesTicketStatus.正常); } - else if (service.validityType == 2 && status != (int)GlobalEnumVars.ServicesTicketStatus.过期) + else if (service.validityType == (int)GlobalEnumVars.ServicesValidityType.TimeFrame && status == (int)GlobalEnumVars.ServicesTicketStatus.正常) { where = where.And(p => p.validityStartTime < dt && p.validityEndTime > dt && p.status == status); } + else if (service.validityType == (int)GlobalEnumVars.ServicesValidityType.TimeFrame && status == (int)GlobalEnumVars.ServicesTicketStatus.作废 || service.validityType == (int)GlobalEnumVars.ServicesValidityType.TimeFrame && status == (int)GlobalEnumVars.ServicesTicketStatus.已核销) + { + where = where.And(p => p.status == status); + } + //不限制时间段的数据 + if (service.validityType == (int)GlobalEnumVars.ServicesValidityType.Unlimited) + { + where = where.And(p => p.status == status); + } var tickets = await _userServicesTicketServices.QueryPageAsync(where, p => p.createTime, OrderByType.Asc, entity.page, entity.limit); if (tickets.Any())