* Move method to model.php.

This commit is contained in:
caoyanyi
2023-09-19 10:08:09 +08:00
parent 2103c7f226
commit f0dbe53b52
2 changed files with 19 additions and 19 deletions
+19
View File
@@ -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');
}
}
-19
View File
@@ -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.