diff --git a/module/execution/model.php b/module/execution/model.php index bfc05e0462..6881e14d1c 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2832,15 +2832,16 @@ class executionModel extends model $this->loadModel('action'); $this->loadModel('kanban'); - $versions = $this->loadModel('story')->getVersions($stories); + $this->loadModel('story'); + $versions = $this->story->getVersions($stories); $linkedStories = $this->dao->select('story,`order`')->from(TABLE_PROJECTSTORY)->where('project')->eq($executionID)->orderBy('order_desc')->fetchPairs('story', 'order'); $lastOrder = (int)reset($linkedStories); - $storyList = $this->dao->select('id, status, branch, product, type')->from(TABLE_STORY)->where('id')->in(array_values($stories))->fetchAll('id'); + $storyList = $this->story->getByList(array_values($stories)); $execution = $this->getByID($executionID); $notAllowedStatus = $this->app->rawMethod == 'batchcreate' ? 'closed' : 'draft,reviewing,closed'; $laneID = isset($output['laneID']) ? $output['laneID'] : 0; - $project = $execution->type == 'project' ? $execution : $this->loadModel('project')->fetchById($execution->project); + $project = $execution->type == 'project' ? $execution : $this->loadModel('project')->getByID($execution->project); foreach($stories as $storyID) { diff --git a/module/kanban/model.php b/module/kanban/model.php index d47653ea31..1044683b3d 100755 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -3507,6 +3507,8 @@ class kanbanModel extends model */ public function getColumnByID(int $columnID) { + if(common::isTutorialMode()) return $this->loadModel('tutorial')->getColumn(); + $column = $this->dao->select('t1.*, t2.type as laneType')->from(TABLE_KANBANCOLUMN)->alias('t1') ->leftJoin(TABLE_KANBANCELL)->alias('t2')->on('t1.id=t2.column') ->where('t1.id')->eq($columnID) diff --git a/module/story/model.php b/module/story/model.php index 4be9727914..4e39be6a3f 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -128,6 +128,8 @@ class storyModel extends model { if(empty($storyIdList)) return array(); + if(common::isTutorialMode()) return $this->loadModel('tutorial')->getStories(); + return $this->dao->select('t1.*, t2.spec, t2.verify, t3.name as productTitle, t3.deleted as productDeleted') ->from(TABLE_STORY)->alias('t1') ->leftJoin(TABLE_STORYSPEC)->alias('t2')->on('t1.id=t2.story') @@ -3107,6 +3109,13 @@ class storyModel extends model */ public function getVersions(string|array $storyIdList): array { + if(common::isTutorialMode()) + { + $versions = array(); + $stories = $this->loadModel('tutorial')->getStories(); + foreach($stories as $story) $versions[$story->id] = $story->version; + return $versions; + } return $this->dao->select('id, version')->from(TABLE_STORY)->where('id')->in($storyIdList)->fetchPairs('id', 'version'); } diff --git a/module/tutorial/model.php b/module/tutorial/model.php index ee13451749..48bc521391 100644 --- a/module/tutorial/model.php +++ b/module/tutorial/model.php @@ -1628,10 +1628,10 @@ class tutorialModel extends model /** * 获取新手模式看板列。 - * Get lane. + * Get columns. * * @access public - * @return object + * @return array */ public function getColumns(): array { @@ -1662,6 +1662,31 @@ class tutorialModel extends model return $columns; } + /** + * 获取新手模式看板列。 + * Get column. + * + * @access public + * @return object + */ + public function getColumn(): object + { + $column = new stdClass(); + $column->id = 1; + $column->parent = 0; + $column->type = 'backlog'; + $column->region = 1; + $column->group = 1; + $column->name = 'Backlog'; + $column->color = '#333'; + $column->limit = -1; + $column->order = 0; + $column->archived = 0; + $column->deleted = 0; + $column->laneType = 'story'; + return $column; + } + /** * 获取新手模式看板卡片。 * Get card.