diff --git a/module/project/model.php b/module/project/model.php index b405a535b9..3108624732 100755 --- a/module/project/model.php +++ b/module/project/model.php @@ -716,6 +716,8 @@ class projectModel extends model */ public function getBranchesByProject(int $projectID): array { + if(common::isTutorialMode()) return $this->loadModel('tutorial')->getBranchesByProject(); + return $this->dao->select('*')->from(TABLE_PROJECTPRODUCT) ->where('project')->eq($projectID) ->fetchGroup('product', 'branch'); diff --git a/module/tutorial/model.php b/module/tutorial/model.php index 370779fe9d..0552d5cbd1 100644 --- a/module/tutorial/model.php +++ b/module/tutorial/model.php @@ -1937,6 +1937,25 @@ class tutorialModel extends model return array(0 => $this->lang->branch->main, 1 => 'Test branch'); } + /** + * 获取新手模式项目关联分支。 + * Get branch by project. + * + * @access public + * @return array + */ + public function getBranchesByProject(): array + { + $branch = new stdClass(); + $branch->project = 2; + $branch->product = 1; + $branch->branch = 0; + $branch->plan = 0; + $branch->roadmap = 0; + + return array(1 => array($branch)); + } + /** * 获取新手模式分支列表。 * Get branches.