* [task#124846,doing,0.3h] add metric calc.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user