From c49a952504eec36abe857dd1a22df874a231c011 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Fri, 6 Dec 2024 13:44:10 +0800 Subject: [PATCH] * [task#133684,done,1h,0h] Finish upgrade charter file config. --- db/zentao.sql | 2 +- module/upgrade/model.php | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/db/zentao.sql b/db/zentao.sql index 8171542abc..4a2d46a46c 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -164,7 +164,7 @@ CREATE TABLE IF NOT EXISTS `zt_approval` ( `version` mediumint(9) NOT NULL DEFAULT '0', `status` varchar(20) NOT NULL DEFAULT 'doing', `result` varchar(20) NOT NULL DEFAULT '', - `extra` text NULL; + `extra` text NULL, `createdBy` char(30) NOT NULL DEFAULT '', `createdDate` datetime NULL, `deleted` tinyint(4) NOT NULL DEFAULT '0', diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 01d75afbd8..86941e22fe 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -10510,4 +10510,27 @@ class upgradeModel extends model return true; } + + /** + * 对立项附件配置做升级处理。 + * Process charter file config. + * + * @access public + * @return bool + */ + public function processCharterFileConfig() + { + $oldCharterFileConfig = $this->loadModel('custom')->getItems('owner=system&module=charter§ion=charterList&vision=or'); + if(!$oldCharterFileConfig) return false; + + $projectApprovalFiles = array(); + foreach($oldCharterFileConfig as $oldCharterFile) $projectApprovalFiles[] = array('index' => $oldCharterFile->key, 'name' => $oldCharterFile->value); + + $charterFiles = json_decode($this->config->custom->charterFiles, true); + foreach($charterFiles as $index => $charterFile) $charterFiles[$index]['projectApproval'] = $projectApprovalFiles; + + $this->loadModel('setting')->setItem('system.custom.charterFiles', json_encode($charterFiles)); + + return true; + } }