From 83dbfde648ef2261762e36e9fb5bebfb67d6a8a5 Mon Sep 17 00:00:00 2001 From: guanxiying Date: Wed, 11 Dec 2019 17:35:43 +0800 Subject: [PATCH] * Fix bug #2461. --- module/project/model.php | 6 +++--- module/user/model.php | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index 165227e7a2..7c9b3c67a5 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2957,14 +2957,14 @@ class projectModel extends model /** * Update user view of project and it's product. * - * @param int $project + * @param int $projectID * @access public * @return void */ - public function updateUserView($project) + public function updateUserView($projectID) { $this->loadModel('user')->updateUserView($projectID, 'project'); - $products = $this->getProducts($project, $withBranch = false); + $products = $this->getProducts($projectID, $withBranch = false); if(!empty($products)) { foreach($products as $productID => $productName) $this->loadModel('user')->updateUserView($productID, 'product'); diff --git a/module/user/model.php b/module/user/model.php index 3b833be00e..9181213d75 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -1404,7 +1404,11 @@ class userModel extends model } $teams = array(); - $stmt = $this->dao->select('root,account')->from(TABLE_TEAM)->where('type')->eq('project') + $stmt = $this->dao->select('root,account')->from(TABLE_TEAM)->alias('team') + ->leftJoin(TABLE_PROJECT)->alias('project') + ->on('team.root=project.id') + ->where('team.type')->eq('project') + ->andWhere('project.deleted')->eq(0) ->beginIF($objectType == 'product')->andWhere('root')->in($linkedProjects)->fi() ->beginIF($objectType == 'project')->andWhere('root')->eq($objectID)->fi() ->query(); @@ -1439,6 +1443,7 @@ class userModel extends model { $this->dao->update(TABLE_USERVIEW)->data($data)->where('account')->eq($account)->exec(); } + exit; } /**