diff --git a/module/metric/calc/execution/hour/consume_of_task_in_type_in_execution.php b/module/metric/calc/execution/hour/consume_of_task_in_type_in_execution.php index cb98b14aca..f936475ab1 100755 --- a/module/metric/calc/execution/hour/consume_of_task_in_type_in_execution.php +++ b/module/metric/calc/execution/hour/consume_of_task_in_type_in_execution.php @@ -15,4 +15,20 @@ class consume_of_task_in_type_in_execution extends baseCalc if(!isset($this->result[$row->type])) $this->result[$row->type] = array(); $this->result[$row->type][$row->id] = $row->consumed; } + + public function getResult($options = array()) + { + foreach($this->result as $type => $tasks) + { + if(!is_array($tasks)) + { + unset($this->result[$type]); + continue; + } + $this->result[$type] = array_sum($tasks); + } + + $records = $this->getRecords(array('type', 'value')); + return $this->filterByOptions($records, $options); + } }