* Code for task #41238.

This commit is contained in:
holan20180123
2021-08-16 16:16:32 +08:00
parent 1b4eba82ba
commit f87de9e569
5 changed files with 81 additions and 5 deletions
+8 -1
View File
@@ -1261,13 +1261,20 @@ class projectModel extends model
*
* @param int $projectID
* @param string $account
* @param string $removeExecution no|yes
* @access public
* @return void
*/
public function unlinkMember($projectID, $account)
public function unlinkMember($projectID, $account, $removeExecution = 'no')
{
$this->dao->delete()->from(TABLE_TEAM)->where('root')->eq((int)$projectID)->andWhere('type')->eq('project')->andWhere('account')->eq($account)->exec();
if($removeExecution == 'yes')
{
$executions = $this->loadModel('execution')->getByProject($projectID, 'undone', 0, true);
$this->dao->delete()->from(TABLE_TEAM)->where('root')->in(array_keys($executions))->andWhere('type')->eq('execution')->andWhere('account')->eq($account)->exec();
}
$this->loadModel('user');
$this->user->updateUserView($projectID, 'project', array($account));