diff --git a/FrontendWebApi/ApiControllers/HydroMeterController.cs b/FrontendWebApi/ApiControllers/HydroMeterController.cs index 7369e71..b571da1 100644 --- a/FrontendWebApi/ApiControllers/HydroMeterController.cs +++ b/FrontendWebApi/ApiControllers/HydroMeterController.cs @@ -166,7 +166,7 @@ namespace FrontendWebApi.ApiControllers apiResult.Msg = "棟別沒有被選取"; return BadRequest(apiResult); } - else if (input.tableType == null || tableType.Contains(input.tableType)) + else if (input.tableType == null || !tableType.Contains(input.tableType)) { apiResult.Code = "9999"; apiResult.Msg = "表單類別錯誤"; @@ -177,7 +177,7 @@ namespace FrontendWebApi.ApiControllers { var startTime = input.tableType == "day" || input.tableType == "week" ? input.startTime + "-01" - : input.tableType == "month" || input.tableType == "month" ? input.startTime + "-01-01" + : input.tableType == "month" || input.tableType == "year" ? input.startTime + "-01-01" : null; var endTime = input.tableType == "day" || input.tableType == "week" ? input.startTime.Split("-")[0] + "-" + (Int32.Parse(input.startTime.Split("-")[1]) + 1).ToString().PadLeft(2, '0') + "-01"