Merge branch 'sprint/183_tianshujie_18838' into 'master'

* Fix bug #18838.

See merge request easycorp/zentaopms!1591
This commit is contained in:
孙广明
2022-01-25 03:20:31 +00:00
2 changed files with 4 additions and 3 deletions

View File

@@ -2043,7 +2043,7 @@ class execution extends control
if($branches) $branchID = key($branches);
}
$plans = $this->execution->getPlans($products);
$plans = $this->execution->getPlans($products, 'skipParent', $executionID);
$allPlans = array('' => '');
if(!empty($plans))
{

View File

@@ -3735,15 +3735,16 @@ class executionModel extends model
*
* @param int|array $productID
* @param string $param withMainPlan|skipParent
* @param int $executionID
* @return mixed
*/
public function getPlans($products, $param = '')
public function getPlans($products, $param = '', $executionID = 0)
{
$this->loadModel('productplan');
$param = strtolower($param);
$branchIDList = strpos($param, 'withmainplan') !== false ? array(BRANCH_MAIN => BRANCH_MAIN) : array();
$branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noclosed');
$branchGroups = $this->getBranchByProduct(array_keys($products), $executionID, 'noclosed');
foreach($branchGroups as $branches)
{
foreach($branches as $branchID => $branchName) $branchIDList[$branchID] = $branchID;