diff --git a/module/metric/model.php b/module/metric/model.php index 9c7fcec257..7852f4f02b 100755 --- a/module/metric/model.php +++ b/module/metric/model.php @@ -2232,6 +2232,7 @@ class metricModel extends model public function getNoDataTip($code) { $today = helper::today(); + $metric = $this->getByCode($code); $todayData = $this->metricTao->fetchMetricRecordByDate('all', $today, 1); $todayDataWithCode = $this->metricTao->fetchMetricRecordByDate($code, $today, 1); @@ -2241,6 +2242,10 @@ class metricModel extends model /* After the metric item is defined, it is not time to collect, which can be understood as there is no data today and the metric item has no data. */ if(empty($todayData) && empty($dataWithCode)) return $this->lang->metric->noDataBeforeCollect; + /* 度量项是在今天采集后定义的,还没到明天的采集时间,但今天不会再采集一次。*/ + /* The metric is defined after today's collection, not yet at tomorrow's collection time, but not again today. */ + if(!empty($todayData) && (current($todayData)->date < $metric->createdDate)) return $this->lang->metric->noDataBeforeCollect; + /* 度量项定义之后,已到采集时间,但是没有采集到数据,可以理解为今天收集到了数据但是该度量项没有任何数据。*/ /* After the metric item is defined, it is time to collect, but no data is collected, which can be understood as data is collected today, but the metric item has no data. */ if(!empty($todayData) && empty($dataWithCode)) return $this->lang->metric->noDataAfterCollect; diff --git a/module/screen/model.php b/module/screen/model.php index 4a54ae7321..e8197e3193 100644 --- a/module/screen/model.php +++ b/module/screen/model.php @@ -1877,7 +1877,7 @@ class screenModel extends model if($metric->scope != 'system') $tableOption->objectPairs = $this->loadModel('metric')->getPairsByScope($metric->scope); $tableOption->scope = $metric->scope; - $tableOption->createdDate = $metric->createdDate; + $tableOption->noDataTip = $this->metric->getNoDataTip($metric->code); return $tableOption; }