* Finish task#8969.

This commit is contained in:
qiyu-xie
2021-01-26 08:43:02 +08:00
parent 3c3e1d4348
commit b6cc2dca06
2 changed files with 16 additions and 2 deletions
+1 -1
View File
@@ -851,7 +851,7 @@ class product extends control
$this->view->extra = $extra;
$this->view->products = $products;
$this->view->projectID = $this->session->PRJ;
$this->view->programs = $this->loadModel('program')->getPGMPairs();
$this->view->programs = $this->loadModel('program')->getPGMOption();
$this->display();
}
+15 -1
View File
@@ -49,6 +49,20 @@ class programModel extends model
->fetchPairs();
}
/**
* Get program option.
*
* @access public
* @return array
*/
public function getPGMOption()
{
return $this->dao->select('id,name')->from(TABLE_PROGRAM)
->where('type')->eq('program')
->andWhere('deleted')->eq(0)
->fetchPairs();
}
/**
* Get the product associated with the program.
*
@@ -1718,7 +1732,7 @@ class programModel extends model
$PRJProgram = '';
if($id == 'PRJProgram' and $project->parent != 0)
{
$programList = $this->getPGMPairs();
$programList = $this->getPGMOption();
$programIndex = $programID ? strpos($project->path, (string)$programID) : 0;
$projectIndex = strpos($project->path, $project->id);
$programPath = explode(',' , substr($project->path, $programIndex, $projectIndex - $programIndex));