* Fix bug#34420.
This commit is contained in:
@@ -47,7 +47,7 @@ class compileModel extends model
|
||||
*/
|
||||
public function getList($repoID, $jobID, $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
return $this->dao->select('t1.id, t1.name, t1.job, t1.status, DATE_FORMAT(t1.createdDate, "%m-%d %H:%i") AS 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')
|
||||
$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')
|
||||
->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,6 +58,11 @@ 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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,7 +46,7 @@ class jobModel extends model
|
||||
*/
|
||||
public function getList($repoID = 0, $orderBy = 'id_desc', $pager = null, $engine = '', $pipeline = '')
|
||||
{
|
||||
return $this->dao->select('t1.*, DATE_FORMAT(t1.lastExec, "%m-%d %H:%i") AS lastExec, t2.name as repoName, t3.name as jenkinsName')->from(TABLE_JOB)->alias('t1')
|
||||
$jobs = $this->dao->select('t1.*, t2.name as repoName, t3.name as jenkinsName')->from(TABLE_JOB)->alias('t1')
|
||||
->leftJoin(TABLE_REPO)->alias('t2')->on('t1.repo=t2.id')
|
||||
->leftJoin(TABLE_PIPELINE)->alias('t3')->on('t1.server=t3.id')
|
||||
->where('t1.deleted')->eq('0')
|
||||
@@ -56,6 +56,13 @@ class jobModel extends model
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
|
||||
/* Format datetime. */
|
||||
foreach($jobs as $key => $job)
|
||||
{
|
||||
if(!empty($job->lastExec)) $jobs[$key]->lastExec = substr($job->lastExec, 5, 11);
|
||||
}
|
||||
return $jobs;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user