From ebfa70d2d2caa3a540da88b569fd7a943303555e Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Wed, 17 Mar 2021 13:47:31 +0800 Subject: [PATCH] * Adjust code. --- module/product/model.php | 20 -------------------- module/project/model.php | 3 ++- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/module/product/model.php b/module/product/model.php index c300d38790..b8b1fc5a25 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -768,26 +768,6 @@ class productModel extends model return $stories; } - /** - * Get the total number of requirements associated with the product. - * - * @param array $productIdList - * @param string $type - * @param string $status closed|active|draft - * @access public - * @return int - */ - public function getTotalStoriesByProduct($productIdList, $type, $status = '') - { - return $this->dao->select("count(*) as stories")->from(TABLE_STORY) - ->where('type')->eq($type) - ->andWhere('product')->in($productIdList) - ->beginIF($status != '')->andWhere('status')->eq($status) - ->beginIF($status == 'closed')->andWhere('closedReason')->eq('done')->fi() - ->andWhere('deleted')->eq(0) - ->fetch('stories'); - } - /** * Batch get story stage. * diff --git a/module/project/model.php b/module/project/model.php index 5df0b15a77..9adf2e9f48 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -330,7 +330,8 @@ class projectModel extends model ->where('t1.project')->eq($projectID) ->andWhere('t2.type')->eq($type) ->andWhere('t2.product')->in($productIdList) - ->beginIF($status != 'all')->andWhere('t2.status')->eq($status)->fi() + ->beginIF($status == 'active')->andWhere('t2.status')->in('active,changed')->fi() + ->beginIF($status == 'closed')->andWhere('t2.status')->eq('closed')->fi() ->beginIF($status == 'closed')->andWhere('t2.closedReason')->eq('done')->fi() ->andWhere('deleted')->eq('0') ->fetch('stories');