* Fix bug#37124

This commit is contained in:
zenggang
2023-08-09 02:02:37 +00:00
parent bdc534d6d2
commit e5eedd89fa
+2 -7
View File
@@ -47,7 +47,7 @@ class compileModel extends model
*/
public function getList($repoID, $jobID, $orderBy = 'id_desc', $pager = null)
{
$compiles = $this->dao->select('t1.id, t1.name, t1.job, t1.status, t1.createdDate, t1.testtask, t2.pipeline, t2.triggerType, t2.comment, t2.atDay, t2.atTime, t2.engine, t3.name as repoName, t4.name as jenkinsName')->from(TABLE_COMPILE)->alias('t1')
return $this->dao->select('t1.id, t1.name, t1.job, t1.status, t1.createdDate, t1.testtask, t2.pipeline, t2.triggerType, t2.comment, t2.atDay, t2.atTime, t2.engine, t3.name as repoName, t4.name as jenkinsName')->from(TABLE_COMPILE)->alias('t1')
->leftJoin(TABLE_JOB)->alias('t2')->on('t1.job=t2.id')
->leftJoin(TABLE_REPO)->alias('t3')->on('t2.repo=t3.id')
->leftJoin(TABLE_PIPELINE)->alias('t4')->on('t2.server=t4.id')
@@ -58,11 +58,6 @@ class compileModel extends model
->orderBy($orderBy)
->page($pager)
->fetchAll('id');
foreach($compiles as $key => $compile)
{
if(!empty($compile->createdDate)) $compiles[$key]->createdDate = substr($compile->createdDate, 5, 11);
}
return $compiles;
}
/**
@@ -289,7 +284,7 @@ class compileModel extends model
$url = sprintf('%s/job/%s/api/json?tree=builds[id,number,result,queueId,timestamp]', $jenkins->url, $job->pipeline);
}
$response = common::http($url, '', array(CURLOPT_USERPWD => "$jenkinsUser:$jenkinsPassword"));
if(!$response) return;
if(!$response) return false;
$compilePairs = $this->dao->select('queue,job')->from(TABLE_COMPILE)->where('job')->eq($job->id)->andWhere('queue')->gt(0)->fetchPairs();
$jobInfo = json_decode($response);