* Finish task #45083.

This commit is contained in:
tianshujie
2021-11-27 17:58:52 +08:00
parent f4d1a727a7
commit 3bddd21087
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -771,7 +771,7 @@ class execution extends control
$storyBugs = $this->loadModel('bug')->getStoryBugCounts($storyIdList, $executionID);
$storyCases = $this->loadModel('testcase')->getStoryCaseCounts($storyIdList);
$plans = $this->execution->getPlans($products);
$plans = $this->execution->getPlans($products, true, true);
$allPlans = array('' => '');
if(!empty($plans))
{
+4 -3
View File
@@ -3667,14 +3667,14 @@ class executionModel extends model
* Get plans by $productID.
*
* @param int|array $productID
*
* @param bool $skipParent
* @return mixed
*/
public function getPlans($products)
public function getPlans($products, $skipParent = false, $withMainPlan = false)
{
$this->loadModel('productplan');
$branchIDList = array();
$branchIDList = $withMainPlan ? array(BRANCH_MAIN) : array();
foreach($products as $product)
{
foreach($product->branches as $branchID) $branchIDList[$branchID] = $branchID;
@@ -3684,6 +3684,7 @@ class executionModel extends model
->where('product')->in(array_keys($products))
->andWhere('deleted')->eq(0)
->andWhere('branch')->in($branchIDList)->fi()
->beginIF($skipParent)->andWhere('parent')->ne(-1)->fi()
->orderBy('begin desc')
->fetchAll('id');