From b355e3dc6baabcb5342013e2c3958744d3de1454 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Tue, 29 Jul 2025 00:52:25 +0000 Subject: [PATCH] * [bug#64358,done,0.4h] fix bug. --- module/productplan/model.php | 2 +- module/story/model.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/productplan/model.php b/module/productplan/model.php index cd98b7b891..39e3feb7a1 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -143,7 +143,7 @@ class productplanModel extends model } else { - $storyPairs = $this->story->getPairs(0, $plan->id, 'estimate'); + $storyPairs = $this->story->getPairs(0, $plan->id, 'estimate', true); $plan->stories = count($storyPairs); } diff --git a/module/story/model.php b/module/story/model.php index 9538c525e5..b31f770989 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -108,17 +108,18 @@ class storyModel extends model * @param int $productID * @param int $planID * @param string $field + * @param bool $hasParent true|false * @access public * @return array */ - public function getPairs(int $productID = 0, int $planID = 0, string $field = 'title'): array + public function getPairs(int $productID = 0, int $planID = 0, string $field = 'title', bool $hasParent = false): array { return $this->dao->select("id, {$field}")->from(TABLE_STORY) ->where('deleted')->eq('0') ->beginIF($productID)->andWhere('product')->eq($productID)->fi() ->beginIF($planID) ->andWhere("CONCAT(',', `plan`, ',')")->like("%,{$planID},%") - ->andWhere("isParent")->eq('0') + ->beginIF(!$hasParent)->andWhere("isParent")->eq('0')->fi() ->fi() ->fetchPairs(); }