Ver Fonte

Merge remote-tracking branch 'origin/master'

gaoyagang há 1 ano atrás
pai
commit
293d808066
1 ficheiros alterados com 3 adições e 3 exclusões
  1. 3 3
      app/model/dcitemhistorydatamodel.go

+ 3 - 3
app/model/dcitemhistorydatamodel.go

@@ -196,7 +196,7 @@ func (m *defaultDcItemHistoryDataModel) QueryHistoryDataForChart(ctx context.Con
 		timeZero = " 00:00:00"
 	}
 	if in.Aggregator == "realtime" {
-		if in.MinVal != 0 && in.MaxVal != 0 {
+		if in.MinVal != 0 || in.MaxVal != 0 {
 			query := fmt.Sprintf("SELECT t1.item_name AS `name`, t1.val AS `val`, t2.htime AS `htime_at`"+
 				" FROM %s AS t1 JOIN ("+
 				" SELECT hd.item_name,"+
@@ -227,7 +227,7 @@ func (m *defaultDcItemHistoryDataModel) QueryHistoryDataForChart(ctx context.Con
 			err = m.conn.QueryRowsCtx(ctx, &resp, query, in.ItemName, in.Stime, in.Etime, in.ItemName)
 		}
 	} else if in.Aggregator == "new" {
-		if in.MinVal != 0 && in.MaxVal != 0 {
+		if in.MinVal != 0 || in.MaxVal != 0 {
 			query := fmt.Sprintf("SELECT t1.item_name AS `name`, t1.val AS `val`, t2.grouped_h_time AS `htime_at`"+
 				" FROM %s AS t1 JOIN ("+
 				" SELECT hd.item_name,"+
@@ -256,7 +256,7 @@ func (m *defaultDcItemHistoryDataModel) QueryHistoryDataForChart(ctx context.Con
 			err = m.conn.QueryRowsCtx(ctx, &resp, query, in.ItemName, in.Stime, in.Etime, in.ItemName)
 		}
 	} else {
-		if in.MinVal != 0 && in.MaxVal != 0 {
+		if in.MinVal != 0 || in.MaxVal != 0 {
 			query := fmt.Sprintf("SELECT hd.item_name AS `name`, %s(val) AS `val`, "+
 				" CONCAT(DATE_FORMAT(h_time,'%s'),LPAD(FLOOR(DATE_FORMAT(h_time, '%s')/%d)*%d,2,0),'%s') AS `htime_at`"+
 				" FROM %s AS hd "+