Merge branch 'zentaopms_258_bug#29825' into 'master'

* Fix bug #29825.

See merge request easycorp/zentaopms!6179
This commit is contained in:
王怡栋
2022-11-16 02:05:44 +00:00
2 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -119,7 +119,7 @@ class build extends control
$this->view->executionID = $executionID;
$this->view->products = $products;
$this->view->projectID = $projectID;
$this->view->lastBuild = $this->build->getLast($executionID);
$this->view->lastBuild = $this->build->getLast($executionID, $projectID);
$this->view->productGroups = $productGroups;
$this->view->users = $this->user->getPairs('nodeleted|noclosed');
$this->display();
+5 -3
View File
@@ -284,14 +284,16 @@ class buildModel extends model
* Get last build.
*
* @param int $executionID
* @param int $projectID
* @access public
* @return bool | object
*/
public function getLast($executionID)
public function getLast($executionID = 0, $projectID = 0)
{
return $this->dao->select('id, name')->from(TABLE_BUILD)
->where('execution')->eq((int)$executionID)
->andWhere('deleted')->eq(0)
->where('deleted')->eq(0)
->beginIF($executionID)->andWhere('execution')->eq((int)$executionID)->fi()
->beginIF($projectID)->andWhere('project')->eq((int)$projectID)->fi()
->orderBy('date DESC,id DESC')
->limit(1)
->fetch();