* code for task #73991.

This commit is contained in:
wangyidong
2022-11-01 13:28:56 +08:00
parent 9cd542f3c7
commit 4a9e97b29c
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -1787,7 +1787,7 @@ 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 : '');
$copyProjects = $this->loadModel('project')->getPairsByProgram(isset($project->parent) ? $project->parent : '', 'noclosed', '', 'order_asc', '', isset($project->model) ? $project->model : '', true);
$copyProjectID = ($projectID == 0) ? key($copyProjects) : $projectID;
if(!empty($project->hasProduct)) $allProducts = array(0 => '') + $allProducts;
+3 -1
View File
@@ -792,10 +792,11 @@ class projectModel extends model
* @param string $orderBy
* @param string $excludedModel
* @param string $model
* @param bool $onlyMultiple
* @access public
* @return object
*/
public function getPairsByProgram($programID = '', $status = 'all', $isQueryAll = false, $orderBy = 'order_asc', $excludedModel = '', $model = '')
public function getPairsByProgram($programID = '', $status = 'all', $isQueryAll = false, $orderBy = 'order_asc', $excludedModel = '', $model = '', $onlyMultiple = false)
{
if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getProjectPairs();
return $this->dao->select('id, name')->from(TABLE_PROJECT)
@@ -806,6 +807,7 @@ class projectModel extends model
->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($onlyMultiple)->andWhere('multiple')->eq(1)->fi()
->beginIF($status == 'noclosed')->andWhere('status')->ne('closed')->fi()
->beginIF(!$this->app->user->admin and !$isQueryAll)->andWhere('id')->in($this->app->user->view->projects)->fi()
->orderBy($orderBy)