* Finish task #8497.

This commit is contained in:
holan20180123
2020-11-27 16:29:43 +08:00
parent d0953b4484
commit 7aca388cd8
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ class projectrelease extends control
$this->view->title = $this->view->project->name . $this->lang->colon . $this->lang->release->browse;
$this->view->position[] = $this->lang->release->browse;
$this->view->releases = $this->projectrelease->getList($productID, $branch, $type);
$this->view->releases = $this->projectrelease->getList($this->session->PRJ, $productID, $branch, $type);
$this->view->type = $type;
$this->display();
}
+4 -2
View File
@@ -43,19 +43,21 @@ class projectreleaseModel extends model
/**
* Get list of releases.
*
* @param int $projectID
* @param int $productID
* @param int $branch
* @param string $type
* @access public
* @return array
*/
public function getList($productID, $branch = 0, $type = 'all')
public function getList($projectID, $productID, $branch = 0, $type = 'all')
{
return $this->dao->select('t1.*, t2.name as productName, t3.id as buildID, t3.name as buildName, t3.project')
->from(TABLE_RELEASE)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build = t3.id')
->where('t1.product')->eq((int)$productID)
->where('t1.PRJ')->eq((int)$projectID)
->andWhere('t1.product')->eq((int)$productID)
->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($type != 'all')->andWhere('t1.status')->eq($type)->fi()
->andWhere('t1.deleted')->eq(0)