This commit is contained in:
wangyidong
2021-03-31 11:30:52 +08:00
parent 8e0491c487
commit bbda48740f
2 changed files with 17 additions and 1 deletions
+2
View File
@@ -475,6 +475,8 @@ class groupModel extends model
ksort($this->lang->moduleOrder, SORT_ASC);
foreach($this->lang->moduleOrder as $moduleName)
{
if(!isset($resources->$moduleName)) continue;
$resource = $resources->$moduleName;
unset($resources->$moduleName);
$this->lang->resource->$moduleName = $resource;
+15 -1
View File
@@ -3973,7 +3973,21 @@ class upgradeModel extends model
*/
public function adjustPriv15_0()
{
$this->dao->update(TABLE_GROUPPRIV)->set('module')->eq('execution')->where('module')->eq('project')->exec();
$executionPriv = $this->dao->select('*')->from(TABLE_GROUPPRIV)->where('module')->eq('execution')->limit(1)->fetch();
if(empty($executionPriv)) $this->dao->update(TABLE_GROUPPRIV)->set('module')->eq('execution')->where('module')->eq('project')->exec();
$groups = $this->dao->select('id')->from(TABLE_GROUP)->fetchPairs('id', 'id');
foreach($groups as $groupID)
{
$groupPriv = new stdclass();
$groupPriv->group = $groupID;
$groupPriv->module = 'my';
$groupPriv->method = 'work';
$this->dao->replace(TABLE_GROUPPRIV)->data($groupPriv)->exec();
$groupPriv->method = 'contribute';
$this->dao->replace(TABLE_GROUPPRIV)->data($groupPriv)->exec();
}
$stmt = $this->dao->select('*')->from(TABLE_GROUPPRIV)->where('module')->eq('program')->andWhere('method')->like('PGM%')->query();
while($grouppriv = $stmt->fetch())