48 lines
1.3 KiB
PHP
Executable File
48 lines
1.3 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* The control file of metric module of ZenTaoPMS.
|
|
*
|
|
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
|
|
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
|
* @author zhouxin <zhouxin@easycorp.ltd>
|
|
* @package metric
|
|
* @version $Id: control.php 5145 2013-07-15 06:47:26Z zhouxin@easycorp.ltd $
|
|
* @link http://www.zentao.net
|
|
*/
|
|
class metric extends control
|
|
{
|
|
/**
|
|
* __construct.
|
|
*
|
|
* @access public
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* 计算度量项。
|
|
* Excute metric.
|
|
*
|
|
* @access public
|
|
* @return void
|
|
*/
|
|
public function updateMetricLib()
|
|
{
|
|
$calcList = $this->metric->getCalcList();
|
|
$classifiedCalcGroup = $this->metric->classifyCalc($calcList);
|
|
|
|
foreach($classifiedCalcGroup as $calcGroup)
|
|
{
|
|
$rows = $this->metricZen->prepareDataset($calcGroup)->fetchAll();
|
|
$this->metricZen->calcMetric($rows, $calcGroup->calcList);
|
|
}
|
|
|
|
$records = $this->metricZen->prepareMetricRecord($calcList);
|
|
|
|
$this->metric->insertMetricLib($records);
|
|
}
|
|
}
|