* adjust upgrade.

This commit is contained in:
wangyidong
2021-04-07 14:45:13 +08:00
parent 0d960a60d9
commit 0ca7f575aa
+21 -12
View File
@@ -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';