This commit is contained in:
dev02 2023-05-15 12:59:06 +08:00
commit c3b09e6452

View File

@ -166,7 +166,7 @@ namespace FrontendWebApi.ApiControllers
apiResult.Msg = "棟別沒有被選取"; apiResult.Msg = "棟別沒有被選取";
return BadRequest(apiResult); 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.Code = "9999";
apiResult.Msg = "表單類別錯誤"; apiResult.Msg = "表單類別錯誤";
@ -177,7 +177,7 @@ namespace FrontendWebApi.ApiControllers
{ {
var startTime = input.tableType == "day" || input.tableType == "week" var startTime = input.tableType == "day" || input.tableType == "week"
? input.startTime + "-01" ? input.startTime + "-01"
: input.tableType == "month" || input.tableType == "month" ? input.startTime + "-01-01" : input.tableType == "month" || input.tableType == "year" ? input.startTime + "-01-01"
: null; : null;
var endTime = input.tableType == "day" || input.tableType == "week" var endTime = input.tableType == "day" || input.tableType == "week"
? input.startTime.Split("-")[0] + "-" + (Int32.Parse(input.startTime.Split("-")[1]) + 1).ToString().PadLeft(2, '0') + "-01" ? input.startTime.Split("-")[0] + "-" + (Int32.Parse(input.startTime.Split("-")[1]) + 1).ToString().PadLeft(2, '0') + "-01"