From 539205f9cb84fab3c5171ebaef8f3f2e64f9ebfe Mon Sep 17 00:00:00 2001 From: wanyongkang <937888580@qq.com> Date: Thu, 26 Nov 2020 18:16:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Services/Hncore.Pass.Vpn/Service/ProductOrderService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Services/Hncore.Pass.Vpn/Service/ProductOrderService.cs b/Services/Hncore.Pass.Vpn/Service/ProductOrderService.cs index 66ba8dd..292da11 100644 --- a/Services/Hncore.Pass.Vpn/Service/ProductOrderService.cs +++ b/Services/Hncore.Pass.Vpn/Service/ProductOrderService.cs @@ -759,7 +759,7 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel, var lastOrder = await GetLastOrderByAccount(account); //获取使用天数 - var useDay = (int)Math.Ceiling((DateTime.Now - accountInfo.CreateTime).TotalDays); + var useDay = (int)Math.Ceiling((DateTime.Now - lastOrder.UpdateTime).TotalDays); var refundAmount = lastOrder.PaymentAmount / lastOrder.AccountCount - useDay * refundDayPrice.Value * accountInfo.ConnectCount; refundAmount = refundAmount <= 0 ? 0 : refundAmount; var order = new ProductOrderEntity() @@ -786,7 +786,7 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel, Remark = "退款", RefundReason = reason, }; - var time = (accountInfo.EndTime - DateTime.Now).Value; + var time = (lastOrder.EndTime - DateTime.Now).Value; order.RefundRestTime = time.ToString(@"d\天hh\时mm\分"); var againBuy = lastOrder.OrderType == OrderType.AgainBuy || lastOrder.OrderType == OrderType.AgainBuys; @@ -841,11 +841,11 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel, var refundDayPrice = userPrice == null ? product.RefundDayPrice : userPrice.RefundDayPrice; var lastOrder = await GetLastOrderByAccount(account); - var useDay = (int)Math.Ceiling((DateTime.Now - accountInfo.CreateTime).TotalDays); + var useDay = (int)Math.Ceiling((DateTime.Now - lastOrder.UpdateTime).TotalDays); var RefundAmount = lastOrder.PaymentAmount / lastOrder.AccountCount - useDay * refundDayPrice.Value * accountInfo.ConnectCount; RefundAmount = RefundAmount <= 0 ? 0 : RefundAmount; - var time = (accountInfo.EndTime - DateTime.Now).Value; + var time = (lastOrder.EndTime - DateTime.Now).Value; var RefundRestTime = time.ToString(@"d\天hh\时mm\分"); var info = $"{accountInfo.Account}已使用{useDay}天,剩余{RefundRestTime},可退金额{RefundAmount}元";