diff --git a/module/story/model.php b/module/story/model.php index 29c5bfe8f2..29d0801f73 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -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'); + } } diff --git a/module/story/tao.php b/module/story/tao.php index b6ca6f9aa3..b9fe16f582 100644 --- a/module/story/tao.php +++ b/module/story/tao.php @@ -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.