* fix for getModuleOwner.

This commit is contained in:
z
2020-08-06 10:51:43 +08:00
parent ae84a5dc24
commit 952c013eca
+6 -3
View File
@@ -594,10 +594,14 @@ class bugModel extends model
public function getModuleOwner($moduleID, $productID)
{
$users = $this->loadModel('user')->getPairs('nodeleted');
$owner = $this->dao->findByID($productID)->from(TABLE_PRODUCT)->fetch('QD');
$owner = isset($users[$owner]) ? $owner : '';
if($moduleID)
{
$module = $this->dao->findByID($moduleID)->from(TABLE_MODULE)->fetch();
$module = $this->dao->findByID($moduleID)->from(TABLE_MODULE)->andWhere('root')->eq($productID)->fetch();
if(empty($module)) return $owner;
if($module->owner and isset($users[$module->owner])) return $module->owner;
$moduleIDList = explode(',', trim(str_replace(",$module->id,", ',', $module->path), ','));
@@ -616,8 +620,7 @@ class bugModel extends model
}
}
$owner = $this->dao->findByID($productID)->from(TABLE_PRODUCT)->fetch('QD');
return isset($users[$owner]) ? $owner : '';
return $owner;
}
/**