From 3bef3ada9d4b64e61610e7c7a7e7f1bf8277b344 Mon Sep 17 00:00:00 2001 From: b110212000 Date: Fri, 3 Sep 2021 11:50:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A8=98=E4=BD=8F=E6=88=91(=E4=B8=8D=E8=A6=81?= =?UTF-8?q?=E8=A8=98=E4=BD=8F=E6=88=91)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Controllers/LoginController.cs | 2 +- .../Implement/StationReportRepository.cs | 2 +- SolarPower/Views/Login/Index.cshtml | 57 +++++++++++++++++++ 3 files changed, 59 insertions(+), 2 deletions(-) diff --git a/SolarPower/Controllers/LoginController.cs b/SolarPower/Controllers/LoginController.cs index cad0bd0..b8ca67b 100644 --- a/SolarPower/Controllers/LoginController.cs +++ b/SolarPower/Controllers/LoginController.cs @@ -84,7 +84,7 @@ namespace SolarPower.Controllers return View(); } - + HttpContext.Session.SetString("MyAccount", edFunction.AESEncrypt(user.Account)); //將帳號透過AES加密 HttpContext.Session.SetString("CompanyId", edFunction.AESEncrypt(user.CompanyId.ToString())); //將公司id透過AES加密 diff --git a/SolarPower/Repository/Implement/StationReportRepository.cs b/SolarPower/Repository/Implement/StationReportRepository.cs index aedf0ec..195fde2 100644 --- a/SolarPower/Repository/Implement/StationReportRepository.cs +++ b/SolarPower/Repository/Implement/StationReportRepository.cs @@ -167,7 +167,7 @@ namespace SolarPower.Repository.Implement ) b on a.powerStationid = b.powerStationid and DATE_FORMAT(a.TIMESTAMP,''%Y-%m-%d'') = b.report_date left join ( # month - SELECT powerStationid, ROUND(AVG(TODAYKWH),2) AS monthKWH, + SELECT powerStationid, ROUND(SUM(TODAYKWH),2) AS monthKWH, ROUND(AVG(KWHKWP),2) AS KWHKWP, ROUND(AVG(PR),2) AS PR, ROUND(SUM(MONEY),2) AS money, diff --git a/SolarPower/Views/Login/Index.cshtml b/SolarPower/Views/Login/Index.cshtml index 920ecbf..de2da5f 100644 --- a/SolarPower/Views/Login/Index.cshtml +++ b/SolarPower/Views/Login/Index.cshtml @@ -145,3 +145,60 @@ + + + +