退款
This commit is contained in:
@@ -759,7 +759,7 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
|||||||
|
|
||||||
var lastOrder = await GetLastOrderByAccount(account);
|
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;
|
var refundAmount = lastOrder.PaymentAmount / lastOrder.AccountCount - useDay * refundDayPrice.Value * accountInfo.ConnectCount;
|
||||||
refundAmount = refundAmount <= 0 ? 0 : refundAmount;
|
refundAmount = refundAmount <= 0 ? 0 : refundAmount;
|
||||||
var order = new ProductOrderEntity()
|
var order = new ProductOrderEntity()
|
||||||
@@ -786,7 +786,7 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
|||||||
Remark = "退款",
|
Remark = "退款",
|
||||||
RefundReason = reason,
|
RefundReason = reason,
|
||||||
};
|
};
|
||||||
var time = (accountInfo.EndTime - DateTime.Now).Value;
|
var time = (lastOrder.EndTime - DateTime.Now).Value;
|
||||||
order.RefundRestTime = time.ToString(@"d\天hh\时mm\分");
|
order.RefundRestTime = time.ToString(@"d\天hh\时mm\分");
|
||||||
|
|
||||||
var againBuy = lastOrder.OrderType == OrderType.AgainBuy || lastOrder.OrderType == OrderType.AgainBuys;
|
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 refundDayPrice = userPrice == null ? product.RefundDayPrice : userPrice.RefundDayPrice;
|
||||||
|
|
||||||
var lastOrder = await GetLastOrderByAccount(account);
|
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;
|
var RefundAmount = lastOrder.PaymentAmount / lastOrder.AccountCount - useDay * refundDayPrice.Value * accountInfo.ConnectCount;
|
||||||
RefundAmount = RefundAmount <= 0 ? 0 : RefundAmount;
|
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 RefundRestTime = time.ToString(@"d\天hh\时mm\分");
|
||||||
|
|
||||||
var info = $"{accountInfo.Account}已使用{useDay}天,剩余{RefundRestTime},可退金额{RefundAmount}元";
|
var info = $"{accountInfo.Account}已使用{useDay}天,剩余{RefundRestTime},可退金额{RefundAmount}元";
|
||||||
|
|||||||
Reference in New Issue
Block a user