* Finish task#41217.

This commit is contained in:
qiyu-xie
2021-08-11 16:55:12 +08:00
parent 2a05fe7e21
commit 4acca21bde
10 changed files with 256 additions and 50 deletions
+19
View File
@@ -1256,6 +1256,25 @@ class projectModel extends model
}
}
/**
* Unlink a member.
*
* @param int $projectID
* @param string $account
* @access public
* @return void
*/
public function unlinkMember($projectID, $account)
{
$this->dao->delete()->from(TABLE_TEAM)->where('root')->eq((int)$projectID)->andWhere('type')->eq('project')->andWhere('account')->eq($account)->exec();
$this->loadModel('user');
$this->user->updateUserView($projectID, 'project', array($account));
$linkedProducts = $this->loadModel('product')->getProductPairsByProject($projectID);
if(!empty($linkedProducts)) $this->user->updateUserView(array_keys($linkedProducts), 'product', array($account));
}
/**
* Manage team members.
*