* Fix bug#29896.

This commit is contained in:
xieqiyu
2022-11-16 15:48:18 +08:00
parent 8848d5c462
commit 2a7493ac78
2 changed files with 4 additions and 1 deletions
+2 -1
View File
@@ -88,6 +88,7 @@ class programModel extends model
$dao = $this->dao->select('id, name, program')->from(TABLE_PRODUCT)
->where('deleted')->eq(0)
->andWhere('vision')->eq($this->config->vision)
->beginIF($programID !== '')->andWhere('program')->eq($programID)->fi()
->beginIF($shadow !== 'all')->andWhere('shadow')->eq((int)$shadow)->fi()
->beginIF($mode == 'assign')->andWhere('program')->eq($programID)->fi()
->beginIF(strpos($status, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
@@ -99,7 +100,7 @@ class programModel extends model
$productPrograms = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('type')->eq('program')->andWhere('deleted')->eq('0')->fetchPairs();
/* Put products of current program first.*/
if($mode != 'assign' && $programID)
if(!empty($products) and $mode != 'assign' and $programID)
{
$currentProgramProducts = $products[$programID];
unset($products[$programID]);