* Finish task#8964.

This commit is contained in:
leiyong
2021-01-28 15:48:16 +08:00
parent 527763a1d8
commit 037d1f3798
6 changed files with 54 additions and 11 deletions
+4 -1
View File
@@ -1214,15 +1214,18 @@ class programModel extends model
* Get project pairs.
*
* @param int $programID
* @param status $status all|wait|doing|suspended|closed|noclosed
* @access public
* @return object
*/
public function getPRJPairs($programID = 0)
public function getPRJPairs($programID = 0, $status = 'all')
{
return $this->dao->select('id, name')->from(TABLE_PROJECT)
->where('type')->eq('project')
->andWhere('deleted')->eq(0)
->beginIF($programID)->andWhere('parent')->eq($programID)->fi()
->beginIF($status != 'all' && $status != 'noclosed')->andWhere('status')->eq($status)->fi()
->beginIF($status == 'noclosed')->andWhere('status')->ne('closed')->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
->fetchPairs();
}