Merge branch 'app_zhengrunyu' into 'master'

* Change api for story.

See merge request easycorp/zentaopms!2535
This commit is contained in:
朱金勇
2022-03-28 02:32:18 +00:00
2 changed files with 6 additions and 4 deletions
+5 -3
View File
@@ -53,22 +53,24 @@ class storyEntry extends Entry
}
$story->moduleTitle = $moduleTitle;
$users = $this->loadModel('user')->getList();
$storyTasks = array();
foreach($story->tasks as $executionTasks)
{
foreach($executionTasks as $task)
{
if(!isset($data->data->executions->{$task->execution})) continue;
$storyTasks[] = $this->filterFields($task, 'id,name,type');
$storyTasks[] = $this->filterFields($task, 'id,name,type,status');
}
}
$story->tasks = $storyTasks;
$story->bugs = array();
foreach($data->data->bugs as $bug) $story->bugs[] = $this->filterFields($bug, 'id,title');
foreach($data->data->bugs as $bug) $story->bugs[] = $this->filterFields($bug, 'id,title,status,pri,severity');
$story->cases = array();
foreach($data->data->cases as $case) $story->cases[] = $this->filterFields($case, 'id,title');
foreach($data->data->cases as $case) $story->cases[] = $this->filterFields($case, 'id,title,pri,status');
$story->requirements = array();
foreach($data->data->relations as $relation) $story->requirements[] = $this->filterFields($relation, 'id,title');
+1 -1
View File
@@ -1122,7 +1122,7 @@ class story extends control
$story->files = $this->loadModel('file')->getByObject($story->type, $storyID);
$product = $this->dao->findById($story->product)->from(TABLE_PRODUCT)->fields('name, id, type, status')->fetch();
$plan = $this->dao->findById($story->plan)->from(TABLE_PRODUCTPLAN)->fetch('title');
$bugs = $this->dao->select('id,title')->from(TABLE_BUG)->where('story')->eq($storyID)->andWhere('deleted')->eq(0)->fetchAll();
$bugs = $this->dao->select('id,title,status,pri,severity')->from(TABLE_BUG)->where('story')->eq($storyID)->andWhere('deleted')->eq(0)->fetchAll();
$fromBug = $this->dao->select('id,title')->from(TABLE_BUG)->where('toStory')->eq($storyID)->fetch();
$cases = $this->dao->select('id,title')->from(TABLE_CASE)->where('story')->eq($storyID)->andWhere('deleted')->eq(0)->fetchAll();
$linkedMRs = $this->loadModel('mr')->getLinkedMRPairs($storyID, 'story');