* code for upgrade.

This commit is contained in:
wangyidong
2020-01-02 09:45:21 +08:00
parent c32da306ee
commit 7af8e82c0d
2 changed files with 30 additions and 0 deletions
+1
View File
@@ -172,6 +172,7 @@ class commonModel extends model
if($module == 'tutorial') return true;
if($module == 'block') return true;
if($module == 'product' and $method == 'showerrornone') return true;
if($module == 'report' and $method == 'annualData') return true;
}
return false;
}
+29
View File
@@ -554,6 +554,10 @@ class upgradeModel extends model
}
$this->appendExec('11_6_5');
case '11_7':
$this->saveLogs('Execute 11_7');
$this->execSQL($this->getUpgradeFile('11.7'));
$this->adjustPriv12_0();
}
$this->deletePatch();
@@ -714,6 +718,7 @@ class upgradeModel extends model
$xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan3.0-beta3.sql';
$confirmContent .= file_get_contents($xuanxuanSql);
}
case '11_7' : $confirmContent .= file_get_contents($this->getUpgradeFile('11.7'));
}
return str_replace('zt_', $this->config->db->prefix, $confirmContent);
}
@@ -3597,6 +3602,30 @@ class upgradeModel extends model
return true;
}
/**
* Adjust priv 12.0.
*
* @access public
* @return bool
*/
public function adjustPriv12_0()
{
$this->saveLogs('Run Method ' . __FUNCTION__);
$groups = $this->dao->select('*')->from(TABLE_GROUPPRIV)->where('module')->eq('file')->andWhere('method')->eq('delete')->fetchPairs('group', 'group');
foreach($groups as $groupID)
{
$groupPriv = new stdclass();
$groupPriv->group = $groupID;
$groupPriv->module = 'doc';
$groupPriv->method = 'deleteFile';
$this->dao->replace(TABLE_GROUPPRIV)->data($groupPriv)->exec();
$this->saveLogs($this->dao->get());
}
return true;
}
/**
* Save Logs.
*