* [bug#64358,done,0.4h] fix bug.

This commit is contained in:
sunguangming
2025-08-06 15:22:13 +08:00
committed by tianshujie
parent d4358e9d53
commit b355e3dc6b
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -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);
}
+3 -2
View File
@@ -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();
}