From 96cbaa1c3ab2d172165e619f771cc93743099c05 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Fri, 23 Feb 2024 19:22:08 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E9=87=91=E9=A2=9D=E5=B0=8F=E6=95=B0?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.Canteen/Order/Response/OrderResultResponse.cs | 9 +++++++-- .../Order/Services/Implements/OrderService.cs | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Src/Dlhis.Canteen/Order/Response/OrderResultResponse.cs b/Src/Dlhis.Canteen/Order/Response/OrderResultResponse.cs index 69418e4d..98d4b96b 100644 --- a/Src/Dlhis.Canteen/Order/Response/OrderResultResponse.cs +++ b/Src/Dlhis.Canteen/Order/Response/OrderResultResponse.cs @@ -1,4 +1,6 @@ -namespace Dlhis.Canteen.Order.Response; +using Newtonsoft.Json; + +namespace Dlhis.Canteen.Order.Response; public class OrderResultResponse { @@ -22,8 +24,11 @@ public class OrderResultResponse /// public string DepartmentName { get; set; } + [JsonIgnore] + public decimal CurrentBalance { get; set; } + /// /// 余额 /// - public decimal Balance { get; set; } + public string Balance => CurrentBalance.ToString("f2"); } diff --git a/Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs b/Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs index 0ecfee6e..6796f695 100644 --- a/Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs +++ b/Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs @@ -95,7 +95,7 @@ public class OrderService : IOrderService UserName = ga.Name, DepartmentNo = ga.DepartmentNo, DepartmentName = department.Name, - Balance = mealUser.Balance + CurrentBalance = mealUser.Balance }) .SingleAsync(); }