* Fix recalculate metriclib.
This commit is contained in:
@@ -164,17 +164,18 @@ class metric extends control
|
||||
*
|
||||
* @param string $code
|
||||
* @param string $date
|
||||
* @param string $calcType
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxUpdateSingleMetricLib($code, $date)
|
||||
public function ajaxUpdateSingleMetricLib($code, $date, $calcType)
|
||||
{
|
||||
$date = str_replace('_', '-', $date);
|
||||
$dateType = $this->metric->getDateTypeByCode($code);
|
||||
|
||||
$isCalcByCron = $this->metric->isCalcByCron($code, $date, $dateType);
|
||||
if($calcType == 'inference') $isCalcByCron = $this->metric->isCalcByCron($code, $date, $dateType);
|
||||
|
||||
if(!$isCalcByCron)
|
||||
if($calcType == 'all' || !$isCalcByCron)
|
||||
{
|
||||
$calc = $this->metric->calculateMetricByCode($code);
|
||||
$record = $this->metricZen->getRecordByCodeAndDate($code, $calc, $date);
|
||||
|
||||
@@ -61,7 +61,7 @@ function recalculateSingle(code, dateType, startDate, endDate)
|
||||
var date = dateToString(dateRange[index]);
|
||||
var $html = recalculateLog(date);
|
||||
|
||||
var link = $.createLink('metric', 'ajaxUpdateSingleMetricLib', 'code=' + code + '&date=' + date);
|
||||
var link = $.createLink('metric', 'ajaxUpdateSingleMetricLib', 'code=' + code + '&date=' + date + '&calcType=' + calcType);
|
||||
$.get(link, function(result){
|
||||
$('.recalculate-log').append($html);
|
||||
updateSingleHistory(dateRange, index + 1);
|
||||
|
||||
Reference in New Issue
Block a user