From da823eacb666fd87b221ddcd5f7347c2cd057507 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Sat, 14 Mar 2020 13:30:58 +0800 Subject: [PATCH] * fix bug. --- db/zentao.sql | 18 ++++++++++++++++++ module/productplan/control.php | 2 +- module/project/control.php | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/db/zentao.sql b/db/zentao.sql index 860c0a3dc5..abb15224af 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -685,6 +685,7 @@ CREATE TABLE IF NOT EXISTS `zt_repohistory` ( -- DROP TABLE IF EXISTS `zt_story`; CREATE TABLE IF NOT EXISTS `zt_story` ( `id` mediumint(8) unsigned NOT NULL auto_increment, + `parent` mediumint(9) NOT NULL default '0', `product` mediumint(8) unsigned NOT NULL default '0', `branch` mediumint(8) unsigned NOT NULL default '0', `module` mediumint(8) unsigned NOT NULL default '0', @@ -1099,6 +1100,23 @@ CREATE TABLE `zt_score` ( KEY `method` (`method`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +-- DROP TABLE IF EXISTS `zt_relation`; +CREATE TABLE IF NOT EXISTS `zt_relation` ( + `id` int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY, + `program` mediumint(8) NOT NULL, + `product` mediumint(8) NOT NULL, + `project` mediumint(8) NOT NULL, + `AType` char(30) NOT NULL, + `AID` mediumint(8) NOT NULL, + `AVersion` char(30) NOT NULL, + `relation` char(30) NOT NULL, + `BType` char(30) NOT NULL, + `BID` mediumint(8) NOT NULL, + `BVersion` char(30) NOT NULL, + `extra` char(30) NOT NULL, + UNIQUE KEY `relation` (`relation`,`AType`,`BType`, `AID`, `BID`) +) ENGINE='MyISAM' DEFAULT CHARSET=utf8; + -- DROP TABLE IF EXISTS `zt_repo`; CREATE TABLE IF NOT EXISTS `zt_repo` ( `id` mediumint(9) NOT NULL AUTO_INCREMENT, diff --git a/module/productplan/control.php b/module/productplan/control.php index 80c9f3a27b..1af6202c4f 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -398,7 +398,7 @@ class productplan extends control } else { - $allStories = $this->story->getProductStories($this->view->product->id, $plan->branch ? "0,{$plan->branch}" : 0, $moduleID = '0', $status = 'draft,active,changed', null, $hasParent = false); + $allStories = $this->story->getProductStories($this->view->product->id, $plan->branch ? "0,{$plan->branch}" : 0, $moduleID = '0', $status = 'draft,active,changed', 'story', 'id_desc', null, $hasParent = false); } $this->view->allStories = $allStories; diff --git a/module/project/control.php b/module/project/control.php index 789184bf02..1a142a16c5 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -2008,7 +2008,7 @@ class project extends control } else { - $allStories = $this->story->getProductStories(array_keys($products), $branches, $moduleID = '0', $status = 'active', $pager = null, $hasParent = false); + $allStories = $this->story->getProductStories(array_keys($products), $branches, $moduleID = '0', $status = 'active', 'story', 'id_desc', $pager = null, $hasParent = false); } foreach($allStories as $id => $story) {