* Move method to model.php.
This commit is contained in:
@@ -5461,4 +5461,23 @@ class storyModel extends model
|
||||
->orderBy('t1.`order`_desc')
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产品所有状态对应的需求总数。
|
||||
* Get stories count of each status by product ID.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $storyType
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getStoriesCountByProductID(int $productID, string $storyType = 'requirement'): array
|
||||
{
|
||||
return $this->dao->select('product, status, count(status) AS count')->from(TABLE_STORY)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('type')->eq($storyType)
|
||||
->andWhere('product')->eq($productID)
|
||||
->groupBy('product, status')
|
||||
->fetchAll('status');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,25 +164,6 @@ class storyTao extends storyModel
|
||||
->fetchGroup('product', 'status');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产品所有状态对应的需求总数。
|
||||
* Get stories count of each status by product ID.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $storyType
|
||||
* @access protected
|
||||
* @return array
|
||||
*/
|
||||
protected function getStoriesCountByProductID(int $productID, string $storyType = 'requirement'): array
|
||||
{
|
||||
return $this->dao->select('product, status, count(status) AS count')->from(TABLE_STORY)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('type')->eq($storyType)
|
||||
->andWhere('product')->eq($productID)
|
||||
->groupBy('product, status')
|
||||
->fetchAll('status');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有完成的需求数量。
|
||||
* Get the count of closed stories.
|
||||
|
||||
Reference in New Issue
Block a user