* [task#133684,done,1h,0h] Finish upgrade charter file config.

This commit is contained in:
wangyuting
2024-12-06 13:46:03 +08:00
committed by 王于听
parent 8c68e9d21b
commit c49a952504
2 changed files with 24 additions and 1 deletions
+1 -1
View File
@@ -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',
+23
View File
@@ -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&section=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;
}
}