Finish task #43918.

This commit is contained in:
root
2021-11-09 13:47:30 +08:00
parent 44c44f11d1
commit 782d1114bf

View File

@@ -453,21 +453,26 @@ class programModel extends model
if($this->cookie->involved or $involved)
{
$stakeholder = $this->dao->select('objectID,user')->from(TABLE_STAKEHOLDER)
$stakeholderGroup = $this->dao->select('objectID,user')->from(TABLE_STAKEHOLDER)
->where('deleted')->eq('0')
->andWhere('objectID')->in(array_keys($projectList))
->fetchGroup('objectID', 'user');
$teamMembers = $this->dao->select('root,account')->from(TABLE_TEAM)
$teamMembersGroup = $this->dao->select('root,account')->from(TABLE_TEAM)
->where('root')->in(array_keys($projectList))
->fetchGroup('root','account');
foreach($projectList as $id => $project)
{
$whitelist = explode(",", $project->whitelist);
if($project->openedBy != $this->app->user->account and $project->PM != $this->app->user->account and !in_array($this->app->user->account, $whitelist) and !isset($teamMembers[$project->id][$this->app->user->account]) and !isset($stakeholder[$project->id][$this->app->user->account]))
{
unset($projectList[$id]);
$pager->recTotal -= 1;
}
if($project->openedBy == $this->app->user->account) continue;
if($project->PM == $this->app->user->account) continue;
if(!in_array($this->app->user->account, $whitelist)) continue;
if(!isset($teamMembers[$project->id][$this->app->user->account])) continue;
if(!isset($stakeholder[$project->id][$this->app->user->account])) continue;
unset($projectList[$id]);
$pager->recTotal -= 1;
}
}