* Adjust action module.

This commit is contained in:
leiyong
2021-03-05 18:12:21 +08:00
parent ba5bf6720a
commit 1dfda97a43
4 changed files with 118 additions and 77 deletions
+19
View File
@@ -491,6 +491,25 @@ class projectModel extends model
->fetchPairs('project');
}
/**
* Get products of a project.
*
* @param int $projectID
* @param bool $withBranch
* @access public
* @return array
*/
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')
->where('t1.project')->eq((int)$projectID)
->andWhere('t2.deleted')->eq(0);
if(!$withBranch) return $query->fetchPairs('id', 'name');
return $query->fetchAll('id');
}
/**
* Build the query.
*