Explorar el Código

点位历史数据加秒级返回&首条末条接口无数据返回空

songxiaohang hace 1 año
padre
commit
8c55f82b91

+ 1 - 1
app/cmd/organization/internal/logic/itemHistoryDataFirstLastByTimeLogic.go

@@ -36,7 +36,7 @@ func (l *ItemHistoryDataFirstLastByTimeLogic) ItemHistoryDataFirstLastByTime(in
 	}
 
 	if err1 == sqlx.ErrNotFound && err2 == sqlx.ErrNotFound {
-		return nil, nil
+		return &pb.ItemHistoryDataFirstLastResp{}, nil
 	}
 
 	return &pb.ItemHistoryDataFirstLastResp{

+ 1 - 1
app/model/dcitemhistorydatamodel.go

@@ -178,7 +178,7 @@ func (m *defaultDcItemHistoryDataModel) QueryHistoryDataForChart(ctx context.Con
 	var err error
 	var selectFormat, timeLpad, timeZero string
 	if in.Interval == "s" {
-		selectFormat = "%Y-%m-%d %H:%i"
+		selectFormat = "%Y-%m-%d %H:%i:"
 		timeLpad = "%s"
 		timeZero = ""
 	} else if in.Interval == "minute" {