* Add metric: count_of_line.

This commit is contained in:
zhouxin
2023-07-25 15:11:34 +08:00
parent 54046496ce
commit 562db384db
2 changed files with 28 additions and 11 deletions
@@ -10,12 +10,12 @@
* 单位:个
* 描述:按全局统计的产品线总数表示整个组织中的产品线数量。此度量项反映了组织的产品线广度,可以用于评估组织的产品组合策略和业务发展方向。
* 定义:所有产品线的个数求和
过滤已删除的产品线
* 过滤已删除的产品线
* 度量库:
* 收集方式:realtime
*
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
* @author qixinzhi <qixinzhi@easycorp.ltd>
* @author zhouxin <zhouxin@easycorp.ltd>
* @package
* @uses func
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
@@ -23,20 +23,18 @@
*/
class count_of_line extends baseCalc
{
public $dataset = null;
public $dataset = 'getLines';
public $fieldList = array();
public $fieldList = array('t1.id');
//public funtion getStatement($dao)
//{
//}
public function calculate($data)
public function calculate($row)
{
$this->result ++;
}
public function getResult($options = array())
{
return $this->filterByOptions($this->result, $options);
$records = array(array('value' => $this->result));
return $this->filterByOptions($records, $options);
}
}
}
+19
View File
@@ -317,4 +317,23 @@ class dataset
->andWhere('t3.deleted')->eq(0)
->query();
}
/**
* 获取产品线数据。
* Get product lines.
*
* @param string $fieldList
* @access public
* @return PDOStatement
*/
public function getLines($fieldList)
{
return $this->dao->select($fieldList)->from(TABLE_MODULE)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.root=t2.id')
->where('t1.deleted')->eq(0)
->andWhere('t2.deleted')->eq(0)
->andWhere('t1.type')->eq('line')
->andWhere('t2.type')->eq('program')
->query();
}
}