From 49662b5eb603dede429eff7ba8006347727661b2 Mon Sep 17 00:00:00 2001 From: daitingting Date: Tue, 9 May 2017 10:05:41 +0800 Subject: [PATCH] * Process custom menus when upgrade from 9.1.2. --- module/upgrade/model.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 2420f89182..f7659c6806 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -174,6 +174,9 @@ class upgradeModel extends model $this->execSQL($this->getUpgradeFile('9.1')); case '9_1_1': $this->execSQL($this->getUpgradeFile('9.1.1')); + case '9_1_2': + $this->execSQL($this->getUpgradeFile('9.1.2')); + $this->processCustomMenus(); } $this->deletePatch(); @@ -265,6 +268,7 @@ class upgradeModel extends model case '9_0_1': $confirmContent .= file_get_contents($this->getUpgradeFile('9.0.1')); case '9_1': $confirmContent .= file_get_contents($this->getUpgradeFile('9.1')); case '9_1_1': $confirmContent .= file_get_contents($this->getUpgradeFile('9.1.1')); + case '9_1_2': $confirmContent .= file_get_contents($this->getUpgradeFile('9.1.2')); } return str_replace('zt_', $this->config->db->prefix, $confirmContent); } @@ -1691,4 +1695,22 @@ class upgradeModel extends model if(strpos($fromVersion, 'pro') === false ? $fromVersion < '8.3' : $fromVersion < 'pro5.4') $needProcess['updateFile'] = true; return $needProcess; } + + /** + * Process customMenus for different working. + * + * @access public + * @return void + */ + public function processCustomMenus() + { + $customMenus = $this->dao->select('*')->from(TABLE_CONFIG)->where('section')->eq('customMenu')->fetchAll(); + + foreach($customMenus as $customMenu) + { + $this->dao->update(TABLE_CONFIG)->set('`key`')->eq("full_{$customMenu->key}")->where('id')->eq($customMenu->id)->exec(); + } + + return !dao::isError(); + } }