* [misc] add initRecord for base calc class.
This commit is contained in:
@@ -109,6 +109,14 @@ class baseCalc
|
||||
*/
|
||||
public $reuse = false;
|
||||
|
||||
/**
|
||||
* 是否启用initMetricRecords,尽可能补零逻辑
|
||||
*
|
||||
* @var bool
|
||||
* @access public
|
||||
*/
|
||||
public $initRecord = true;
|
||||
|
||||
/**
|
||||
* 是否支持独立查询
|
||||
*
|
||||
|
||||
@@ -237,7 +237,7 @@ class metricZen extends metric
|
||||
$metric = $this->metric->getByCode($code);
|
||||
$dateType = $this->metric->getDateTypeByCode($code);
|
||||
$recordCommon = $this->buildRecordCommonFields($metric->id, $code, $now, $dateValues->$dateType);
|
||||
$initRecords = $this->initMetricRecords($recordCommon, $metric->scope);
|
||||
$initRecords = !$calc->initRecord ? array() : $this->initMetricRecords($recordCommon, $metric->scope);
|
||||
|
||||
if($calc->reuse) $this->prepareReuseMetricResult($calc, $options);
|
||||
$results = $calc->getResult($options);
|
||||
|
||||
Reference in New Issue
Block a user