mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-03-22 18:17:21 +08:00
接口端【修复】:修复【我购买的服务商品卡】里面的核销码切换失效的问题。
This commit is contained in:
@@ -2475,15 +2475,25 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
|||||||
where = where.And(p => p.serviceOrderId == entity.id);
|
where = where.And(p => p.serviceOrderId == entity.id);
|
||||||
|
|
||||||
var dt = DateTime.Now;
|
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);
|
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);
|
var tickets = await _userServicesTicketServices.QueryPageAsync(where, p => p.createTime, OrderByType.Asc, entity.page, entity.limit);
|
||||||
if (tickets.Any())
|
if (tickets.Any())
|
||||||
|
|||||||
Reference in New Issue
Block a user