* Fix a bug.

This commit is contained in:
hufangzhou
2021-03-25 13:43:46 +08:00
parent 5f7e004151
commit be42a804ce
+2 -2
View File
@@ -514,9 +514,9 @@ class projectModel extends model
public function getProducts($projectID, $withBranch = true)
{
$query = $this->dao->select('t2.id, t2.name, t2.type, t1.branch, t1.plan')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')
->on('t1.product = t2.id')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->where('t1.project')->eq((int)$projectID)
->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi()
->andWhere('t2.deleted')->eq(0);
if(!$withBranch) return $query->fetchPairs('id', 'name');
return $query->fetchAll('id');