* [task#124846,doing,0.3h] add metric calc.

This commit is contained in:
zhouxin
2024-08-07 10:52:09 +08:00
committed by 宋辰轩
parent c3a0a80bb1
commit 50d4bbba42
2 changed files with 22 additions and 2 deletions
@@ -18,3 +18,23 @@
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @Link https://www.zentao.net
*/
class scale_of_dev_story_in_execution extends baseCalc
{
public $dataset = 'getDevStoriesWithExecution';
public $fieldList = array('t3.project', 't1.estimate');
public $result = array();
public function calculate($row)
{
if(!isset($this->result[$row->project])) $this->result[$row->project] = 0;
$this->result[$row->project] += $row->estimate;
}
public function getResult($options = array())
{
$records = $this->getRecords(array('execution', 'value'));
return $this->filterByOptions($records, $options);
}
}
+2 -2
View File
@@ -356,10 +356,10 @@ class dataset
->andWhere('t2.deleted')->eq(0)
->andWhere('t1.type')->eq('story')
->andWhere('t2.shadow')->eq(0)
->andWhere('t4.deleted')->eq(0) // 已删除的执行
->andWhere('t4.deleted')->eq(0)
->andWhere('t4.type')->in('sprint,stage,kanban')
->andWhere('t4.multiple')->eq('1')
->andWhere('t5.deleted')->eq(0); // 已删除的项目
->andWhere('t5.deleted')->eq(0);
return $this->defaultWhere($stmt, 't1');
}