* [misc,done,0.5h] get text fields.
This commit is contained in:
@@ -67,7 +67,7 @@ class storyModel extends model
|
||||
|
||||
if($story->toBug) $story->toBugTitle = $this->dao->findById($story->toBug)->from(TABLE_BUG)->fetch('title');
|
||||
if($story->fromStory) $story->sourceName = $this->dao->select('title')->from(TABLE_STORY)->where('id')->eq($story->fromStory)->fetch('title');
|
||||
if($story->isParent == '1') $story->children = $this->dao->select('*')->from(TABLE_STORY)->where('parent')->eq($storyID)->andWhere('deleted')->eq(0)->orderBy('id_desc')->fetchAll('id');
|
||||
if($story->isParent == '1') $story->children = $this->dao->select('*,path,plan')->from(TABLE_STORY)->where('parent')->eq($storyID)->andWhere('deleted')->eq(0)->orderBy('id_desc')->fetchAll('id');
|
||||
if(isset($story->children)) $story->children = $this->storyTao->mergePlanTitleAndChildren($story->product, $story->children);
|
||||
|
||||
if($story->plan)
|
||||
@@ -300,7 +300,7 @@ class storyModel extends model
|
||||
|
||||
/* 设置查询需求的公共 DAO 变量。 */
|
||||
$browseType = (strpos('bymodule|byproduct', $browseType) !== false and $this->session->storyBrowseType) ? $this->session->storyBrowseType : $browseType;
|
||||
$storyDAO = $this->dao->select("DISTINCT t1.*, t2.*, IF(t2.`pri` = 0, {$this->config->maxPriValue}, t2.`pri`) as priOrder, t3.type as productType, t2.version as version")->from(TABLE_PROJECTSTORY)->alias('t1')
|
||||
$storyDAO = $this->dao->select("DISTINCT t1.*, t2.*, t2.path, t2.plan, IF(t2.`pri` = 0, {$this->config->maxPriValue}, t2.`pri`) as priOrder, t3.type as productType, t2.version as version")->from(TABLE_PROJECTSTORY)->alias('t1')
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t2.product = t3.id')
|
||||
->where('t1.project')->eq($executionID)
|
||||
@@ -358,7 +358,7 @@ class storyModel extends model
|
||||
|
||||
$branchParam = ($type == 'bybranch' and $param !== '') ? $param : (string)$this->cookie->storyBranchParam;
|
||||
|
||||
$stories = $this->dao->select("distinct t1.*, t2.*, IF(t2.`pri` = 0, {$this->config->maxPriValue}, t2.`pri`) as priOrder, t3.type as productType, t2.version as version")->from(TABLE_PROJECTSTORY)->alias('t1')
|
||||
$stories = $this->dao->select("distinct t1.*, t1.path, t1.plan, t2.*, IF(t2.`pri` = 0, {$this->config->maxPriValue}, t2.`pri`) as priOrder, t3.type as productType, t2.version as version")->from(TABLE_PROJECTSTORY)->alias('t1')
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t2.product = t3.id')
|
||||
->where('t1.project')->in($executionIdList)
|
||||
@@ -2579,7 +2579,7 @@ class storyModel extends model
|
||||
$actionIDList = array();
|
||||
if($fieldName == 'assignedBy') $actionIDList = $this->dao->select('objectID')->from(TABLE_ACTION)->where('objectType')->eq('story')->andWhere('action')->eq('assigned')->andWhere('actor')->eq($fieldValue)->fetchPairs('objectID', 'objectID');
|
||||
|
||||
$sql = $this->dao->select("t1.*, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder")->from(TABLE_STORY)->alias('t1');
|
||||
$sql = $this->dao->select("t1.*, t1.path, t1.plan, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder")->from(TABLE_STORY)->alias('t1');
|
||||
if($fieldName == 'reviewBy') $sql = $sql->leftJoin(TABLE_STORYREVIEW)->alias('t2')->on('t1.id = t2.story and t1.version = t2.version');
|
||||
|
||||
$showGrades = isset($this->config->{$type}->showGrades) ? $this->config->{$type}->showGrades : null;
|
||||
@@ -2639,7 +2639,7 @@ class storyModel extends model
|
||||
$showGrades = isset($matches[1]) ? $matches[1] : null;
|
||||
}
|
||||
|
||||
$stories = $this->dao->select("*,IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder")->from(TABLE_STORY)
|
||||
$stories = $this->dao->select("*, path, plan, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder")->from(TABLE_STORY)
|
||||
->where('product')->in($productID)
|
||||
->andWhere('type')->eq($type)
|
||||
->beginIF($showGrades)->andWhere('grade')->in($showGrades)->fi()
|
||||
@@ -3040,7 +3040,7 @@ class storyModel extends model
|
||||
*/
|
||||
public function getUserStories(string $account, string $type = 'assignedTo', string $orderBy = 'id_desc', object|null $pager = null, string $storyType = 'story', bool $includeLibStories = true, string|int $shadow = 0, int $productID = 0): array
|
||||
{
|
||||
$sql = $this->dao->select("t1.*, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder, t2.name as productTitle, t2.shadow as shadow")->from(TABLE_STORY)->alias('t1')
|
||||
$sql = $this->dao->select("t1.*, t1.path, t1.plan, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder, t2.name as productTitle, t2.shadow as shadow")->from(TABLE_STORY)->alias('t1')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id');
|
||||
if($type == 'reviewBy') $sql = $sql->leftJoin(TABLE_STORYREVIEW)->alias('t3')->on('t1.id = t3.story and t1.version = t3.version');
|
||||
|
||||
@@ -3963,7 +3963,7 @@ class storyModel extends model
|
||||
foreach($stories as $story) $rootIdList[$story->root] = $story->root;
|
||||
if(empty($rootIdList)) return $stories;
|
||||
|
||||
$children = $this->dao->select('*')->from(TABLE_STORY)
|
||||
$children = $this->dao->select('*,path,plan')->from(TABLE_STORY)
|
||||
->where('root')->in($rootIdList)
|
||||
->andWhere('product')->eq($productID)
|
||||
->andWhere('deleted')->eq('0')
|
||||
|
||||
Reference in New Issue
Block a user