[後端] 修改時間變更問題

This commit is contained in:
dev02 2023-12-25 09:23:45 +08:00
parent bdf9579503
commit 9202b7edf8

View File

@ -67,11 +67,7 @@ namespace FrontendWebApi.ApiControllers
? input.startTime + "-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"
: input.tableType == "month" ? (Int32.Parse(input.startTime.Split("-")[0]) + 1) + "-01-01"
: input.tableType == "year" ? (Int32.Parse(input.endTime) + 1).ToString() + "-01-01"
: null;
var endTime = DateTime.Parse(startTime).AddMonths(1).ToString("yyyy-MM-dd");
string sqlWhere = "";
string sqlGroup = "";
string sqlAvgRawData = "";
@ -239,11 +235,7 @@ namespace FrontendWebApi.ApiControllers
? input.startTime + "-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"
: input.tableType == "month" ? (Int32.Parse(input.startTime.Split("-")[0]) + 1) + "-01-01"
: input.tableType == "year" ? (Int32.Parse(input.endTime) + 1).ToString() + "-01-01"
: null;
var endTime = DateTime.Parse(startTime).AddMonths(1).ToString("yyyy-MM-dd");
string sqlWhere = "";
string sqlGroup = "";
string sqlAvgRawData = "";