* Code for task #118291, step 2.

This commit is contained in:
sunguangming
2024-05-15 10:43:56 +08:00
parent 77fef40412
commit e66b29319b
4 changed files with 29 additions and 6 deletions
@@ -20,7 +20,7 @@
*/
class count_of_finished_story_in_project extends baseCalc
{
public $dataset = 'getDevStoriesWithProject';
public $dataset = 'getAllStoriesWithProject';
public $fieldList = array('t3.project', 't1.closedReason');
@@ -20,7 +20,7 @@
*/
class count_of_unclosed_story_in_project extends baseCalc
{
public $dataset = 'getDevStoriesWithProject';
public $dataset = 'getAllStoriesWithProject';
public $fieldList = array('t3.project', 't1.status');
@@ -20,9 +20,9 @@
*/
class scale_of_story_in_project extends baseCalc
{
public $dataset = 'getDevStoriesWithProject';
public $dataset = 'getAllStoriesWithProject';
public $fieldList = array('t3.project', 't1.estimate', 't1.parent');
public $fieldList = array('t3.project', 't1.estimate', 't1.isParent');
public $result = array();
@@ -30,9 +30,9 @@ class scale_of_story_in_project extends baseCalc
{
$project = $row->project;
$estimate = $row->estimate;
$parent = $row->parent;
$isParent = $row->isParent;
if($parent == '-1') return false;
if($isParent == '1') return false;
if(!isset($this->result[$project])) $this->result[$project] = 0;
$this->result[$project] += $estimate;
+23
View File
@@ -383,6 +383,29 @@ class dataset
return $this->defaultWhere($stmt, 't1');
}
/**
* 获取项目的所有需求数据。
* Get story list, with project story.
*
* @param string $fieldList
* @access public
* @return PDOStatement
*/
public function getAllStoriesWithProject($fieldList)
{
$stmt = $this->dao->select($fieldList)
->from(TABLE_STORY)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')
->leftJoin(TABLE_PROJECTSTORY)->alias('t3')->on('t1.id=t3.story')
->leftJoin(TABLE_PROJECT)->alias('t4')->on('t3.project=t4.id')
->where('t1.deleted')->eq(0)
->andWhere('t2.deleted')->eq(0)
->andWhere('t4.deleted')->eq(0)
->andWhere('t4.type')->eq('project');
return $this->defaultWhere($stmt, 't1');
}
/**
* 获取研发需求数据,过滤影子产品。
* Get story list, filter shadow product.