Merge branch 'sprint/hufangzhou_task_85050' into 'master'

* Finish task #85050.

See merge request easycorp/zentaopms!7012
This commit is contained in:
孙广明
2023-02-21 05:54:46 +00:00
2 changed files with 14 additions and 9 deletions
+6 -1
View File
@@ -1862,7 +1862,12 @@ class execution extends control
$this->loadModel('product');
$allProducts = $this->product->getProductPairsByProject($projectID, 'noclosed');
$copyProjects = $this->loadModel('project')->getPairsByProgram(isset($project->parent) ? $project->parent : '', 'noclosed', '', 'order_asc', '', isset($project->model) ? $project->model : '', 'multiple');
$projectModel = isset($project->model) ? $project->model : '';
if($projectModel == 'agileplus') $projectModel = array('scrum', 'agileplus');
if($projectModel == 'waterfallplus') $projectModel = array('waterfall', 'waterfallplus');
$copyProjects = $this->loadModel('project')->getPairsByProgram(isset($project->parent) ? $project->parent : '', 'noclosed', '', 'order_asc', '', $projectModel, 'multiple');
$copyProjectID = ($projectID == 0) ? key($copyProjects) : $projectID;
if(!empty($project->hasProduct)) $allProducts = array(0 => '') + $allProducts;
+8 -8
View File
@@ -818,13 +818,13 @@ class projectModel extends model
/**
* Get project pairs by programID.
*
* @param int $programID
* @param status $status all|wait|doing|suspended|closed|noclosed
* @param bool $isQueryAll
* @param string $orderBy
* @param string $excludedModel
* @param string $model
* @param string $param multiple|product
* @param int $programID
* @param status $status all|wait|doing|suspended|closed|noclosed
* @param bool $isQueryAll
* @param string $orderBy
* @param string $excludedModel
* @param string|array $model
* @param string $param multiple|product
* @access public
* @return object
*/
@@ -839,7 +839,7 @@ class projectModel extends model
->beginIF($programID === 0)->andWhere('parent')->eq(0)->fi()
->beginIF($status != 'all' and $status != 'noclosed')->andWhere('status')->eq($status)->fi()
->beginIF($excludedModel)->andWhere('model')->ne($excludedModel)->fi()
->beginIF($model)->andWhere('model')->eq($model)->fi()
->beginIF($model)->andWhere('model')->in($model)->fi()
->beginIF(strpos($param, 'multiple') !== false)->andWhere('multiple')->eq(1)->fi()
->beginIF(strpos($param, 'product') !== false)->andWhere('hasProduct')->eq(1)->fi()
->beginIF($status == 'noclosed')->andWhere('status')->ne('closed')->fi()