From 0ca7f575aa4fbea6904d4e25c2ce953dd4b354fc Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Apr 2021 14:45:13 +0800 Subject: [PATCH] * adjust upgrade. --- module/upgrade/model.php | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index a634baef52..d842d7b184 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -38,6 +38,7 @@ class upgradeModel extends model { set_time_limit(0); $executeXuanxuan = false; + $execute15SQL = false; switch($fromVersion) { case '0_3beta': @@ -634,13 +635,21 @@ class upgradeModel extends model $this->appendExec('12_5_2'); case '12_5_3': $this->saveLogs('Execute 12_5_3'); - $this->appendExec('12_5_3'); - case '15_0': - $this->saveLogs('Execute 15_0'); $this->execSQL($this->getUpgradeFile('15.0')); $this->adjustWhitelistOfProject(); $this->adjustWhitelistOfProduct(); $this->adjustPriv15_0(); + $this->appendExec('12_5_3'); + $execute15SQL = true; + case '15_0': + $this->saveLogs('Execute 15_0'); + if(!$execute15SQL) + { + $this->execSQL($this->getUpgradeFile('15.0')); + $this->adjustWhitelistOfProject(); + $this->adjustWhitelistOfProduct(); + $this->adjustPriv15_0(); + } $this->appendExec('15_0'); } @@ -3995,7 +4004,7 @@ class upgradeModel extends model $this->dao->replace(TABLE_GROUPPRIV)->data($groupPriv)->exec(); } - $stmt = $this->dao->select('group,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('program')->andWhere('method')->like('PGM%')->query(); + $stmt = $this->dao->select('`group`,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('program')->andWhere('method')->like('PGM%')->query(); while($grouppriv = $stmt->fetch()) { $this->dao->delete()->from(TABLE_GROUPPRIV)->where('module')->eq($grouppriv->module)->andWhere('method')->eq($grouppriv->method)->exec(); @@ -4006,7 +4015,7 @@ class upgradeModel extends model $this->dao->replace(TABLE_GROUPPRIV)->data($grouppriv)->exec(); } - $stmt = $this->dao->select('group,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('program')->andWhere('method')->like('PRJ%')->query(); + $stmt = $this->dao->select('`group`,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('program')->andWhere('method')->like('PRJ%')->query(); while($grouppriv = $stmt->fetch()) { $this->dao->delete()->from(TABLE_GROUPPRIV)->where('module')->eq($grouppriv->module)->andWhere('method')->eq($grouppriv->method)->exec(); @@ -4018,7 +4027,7 @@ class upgradeModel extends model $this->dao->replace(TABLE_GROUPPRIV)->data($grouppriv)->exec(); } - $stmt = $this->dao->select('group,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('project')->andWhere('method')->eq('story')->query(); + $stmt = $this->dao->select('`group`,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('project')->andWhere('method')->eq('story')->query(); while($grouppriv = $stmt->fetch()) { $grouppriv->module = 'projectstory'; @@ -4026,7 +4035,7 @@ class upgradeModel extends model $this->dao->replace(TABLE_GROUPPRIV)->data($grouppriv)->exec(); } - $stmt = $this->dao->select('group,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('story')->andWhere('method')->eq('view')->query(); + $stmt = $this->dao->select('`group`,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('story')->andWhere('method')->eq('view')->query(); while($grouppriv = $stmt->fetch()) { $grouppriv->module = 'projectstory'; @@ -4034,7 +4043,7 @@ class upgradeModel extends model $this->dao->replace(TABLE_GROUPPRIV)->data($grouppriv)->exec(); } - $stmt = $this->dao->select('group,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('project')->andWhere('method')->eq('linkstory')->query(); + $stmt = $this->dao->select('`group`,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('project')->andWhere('method')->eq('linkstory')->query(); while($grouppriv = $stmt->fetch()) { $grouppriv->module = 'projectstory'; @@ -4042,7 +4051,7 @@ class upgradeModel extends model $this->dao->replace(TABLE_GROUPPRIV)->data($grouppriv)->exec(); } - $stmt = $this->dao->select('group,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('project')->andWhere('method')->eq('unlinkstory')->query(); + $stmt = $this->dao->select('`group`,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('project')->andWhere('method')->eq('unlinkstory')->query(); while($grouppriv = $stmt->fetch()) { $grouppriv->module = 'projectstory'; @@ -4050,7 +4059,7 @@ class upgradeModel extends model $this->dao->replace(TABLE_GROUPPRIV)->data($grouppriv)->exec(); } - $stmt = $this->dao->select('group,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('execution')->andWhere('method')->eq('all')->query(); + $stmt = $this->dao->select('`group`,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('execution')->andWhere('method')->eq('all')->query(); while($grouppriv = $stmt->fetch()) { $grouppriv->module = 'project'; @@ -4066,14 +4075,14 @@ class upgradeModel extends model $this->dao->replace(TABLE_GROUPPRIV)->data($grouppriv)->exec(); } - $stmt = $this->dao->select('group,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('doc')->andWhere('method')->eq('createlib')->query(); + $stmt = $this->dao->select('`group`,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('doc')->andWhere('method')->eq('createlib')->query(); while($grouppriv = $stmt->fetch()) { $grouppriv->method = 'createLib'; $this->dao->replace(TABLE_GROUPPRIV)->data($grouppriv)->exec(); } - $stmt = $this->dao->select('group,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('doc')->andWhere('method')->eq('editlib')->query(); + $stmt = $this->dao->select('`group`,module,method')->from(TABLE_GROUPPRIV)->where('module')->eq('doc')->andWhere('method')->eq('editlib')->query(); while($grouppriv = $stmt->fetch()) { $grouppriv->method = 'editLib';