* Adjust code.

This commit is contained in:
leiyong
2021-03-17 13:47:31 +08:00
parent 08ec8f2280
commit ebfa70d2d2
2 changed files with 2 additions and 21 deletions
-20
View File
@@ -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.
*
+2 -1
View File
@@ -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');