* Add some metrics.

This commit is contained in:
zhouxin
2023-07-04 14:52:55 +08:00
parent 971e132b65
commit 185d3e890c
4 changed files with 69 additions and 0 deletions
@@ -0,0 +1,17 @@
<?php
include dirname(__FILE__, 4) . DS . 'func.class.php';
class count_of_developed_story_in_execution
{
public function getResult()
{
$storyCountList = $this->dao->select('count(t1.id) as count') ->from(TABLE_STORY)->alias('t1')
->leftJoin(TABLE_PROJECTSTORY)->alias('t2')->on('t1.id=t2.story')
->where('t1.stage')->in('developed,testing,tested,verified,released')
->orWhere('t1.stage', true)->eq('closed')
->andWhere('t1.closedReason')->eq('done')
->markRight()
->groupBy('t2.project')
->fetchAll('project');
}
}
@@ -0,0 +1,18 @@
<?php
include dirname(__FILE__, 4) . DS . 'func.class.php';
class count_of_marker_release extends func
{
public $dataset = 'getReleaseList';
public $fieldList = array('t1.id', 't1.marker');
public function calculate($data)
{
if(!empty($data->marker) and $data->marker == 1) $this->result ++;
}
public function getResult()
{
return $this->result;
}
}
@@ -0,0 +1,14 @@
<?php
include dirname(__FILE__, 4) . DS . 'func.class.php';
class count_of_product extends func
{
public $dao = null;
public function getResult()
{
return $this->dao->select('count(id)')->from(TABLE_PRODUCT)
->where('deleted')->eq(0)
->andWhere('shadow')->eq(0)
->fetch();
}
}
@@ -0,0 +1,20 @@
<?php
include dirname(__FILE__, 4) . DS . 'func.class.php';
class count_of_release_in_year extends func
{
public $dataset = 'getReleaseList';
public $fieldList = array('t1.id', 't1.createdDate');
public function calculate($data)
{
$value = $data->createdDate;
if(empty($this->result[$value])) $this->result[$value] = 0;
$this->result[$value] ++;
}
public function getResult()
{
return $this->result;
}
}