* finish task #40111

This commit is contained in:
zenggang
2021-07-14 14:44:48 +08:00
parent 49892661bf
commit c29583f980
4 changed files with 6 additions and 4 deletions
+2 -1
View File
@@ -490,11 +490,12 @@ class projectModel extends model
* @access public
* @return array
*/
public function getProducts($projectID, $withBranch = true)
public function getProducts($projectID, $withBranch = true, $status = 'all')
{
$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)
->beginIF(strpos($status, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
->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');