fix 恢复now

This commit is contained in:
2024-11-18 11:25:56 +08:00
parent 5033d895ea
commit a2037e7eef

View File

@@ -536,14 +536,14 @@ public class OrderService : IOrderService
/// <param name="idNo"></param>
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)
.Select(x => new { x.Start, x.End })
.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();