This commit is contained in:
guanxiying
2019-12-11 17:37:26 +08:00
parent b5df580b60
commit 83dbfde648
2 changed files with 9 additions and 4 deletions
+3 -3
View File
@@ -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');
+6 -1
View File
@@ -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;
}
/**