From ce553a5523acc46e3c1c0249ab73666dbc85c124 Mon Sep 17 00:00:00 2001 From: xiaoguo Date: Tue, 18 Jun 2024 15:17:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=20=E8=AE=BE=E5=A4=87OEE?= =?UTF-8?q?=E6=9C=88=E7=BB=9F=E8=AE=A1=20=E4=B8=8D=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Repositories/Impl/EquipmentRecordRepository.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CVDEMCS/Services/Repositories/Impl/EquipmentRecordRepository.cs b/CVDEMCS/Services/Repositories/Impl/EquipmentRecordRepository.cs index c0ed1d2..856ad63 100644 --- a/CVDEMCS/Services/Repositories/Impl/EquipmentRecordRepository.cs +++ b/CVDEMCS/Services/Repositories/Impl/EquipmentRecordRepository.cs @@ -742,7 +742,7 @@ namespace PVDEMCS.Services.Repositories.Impl if (item.TotalMonth == DateTime.Now.ToString("yyyy-MM")) { //初尝值不包括今天 - // days = now.Day - 1; + days = now.Day - 1; //获取当月到当前的分钟 minutes = days * 60 * 24 + (now.Hour - 1) * 60 + now.Minute; } @@ -816,7 +816,7 @@ namespace PVDEMCS.Services.Repositories.Impl WHERE info.id = '{equipmentId}' AND total_day >= '{beg}' - AND total_day <= '{endDate}' + AND total_day <= '{end}' GROUP BY EquipmentId, EquipmentType"; @@ -858,9 +858,8 @@ namespace PVDEMCS.Services.Repositories.Impl { days = Convert.ToDecimal((endDate - begDate).TotalDays); } - if (end == DateTime.Now.ToString("yyyy-MM-dd")) + if (endDate.ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd")) { - //days = days - 1; minutes = days * 60 * 24 + (now.Hour - 1) * 60 + now.Minute; } else