fix 时间判断

This commit is contained in:
2024-10-31 12:30:14 +08:00
parent 390452f57b
commit 73fa5691fc

View File

@@ -667,10 +667,10 @@ public class OrderService : BaseOrderService, IOrderService
private async Task EMealVoucherConsumeAsync(ConsumeRequest request, GainfoEntity gainfo, string originData, string no, string idNo)
{
var nowDate = DateTime.Now.Date;
var now = DateTime.Now;
var current = await DbContext.Queryable<EMealVoucherDetailEntity>()
.Where(x => x.No == no && x.IdNo == idNo).SingleAsync();
(nowDate >= current.Start && nowDate <= current.End).ThrowIfFalse("餐券已过期");
(now >= current.Start && now <= current.End).ThrowIfFalse("餐券已过期");
var eMealVoucher = await DbContext.Queryable<EMealVoucherEntity>().Where(x => x.No == no).SingleAsync();