Fix adding the status to job->getById
This commit is contained in:
@@ -113,16 +113,16 @@ class Job extends CI_Model {
|
|||||||
*/
|
*/
|
||||||
public function getById($job_id) {
|
public function getById($job_id) {
|
||||||
$job = $this->db->get_where('jobs', array('id' => $job_id))->row_array();
|
$job = $this->db->get_where('jobs', array('id' => $job_id))->row_array();
|
||||||
return array_map(function($var) {
|
|
||||||
if ($var['started_at'] == '0000-00-00 00:00:00') {
|
if ($job['started_at'] == '0000-00-00 00:00:00') {
|
||||||
$var['status'] = 'pending';
|
$job['status'] = 'pending';
|
||||||
} else if ($var['finished_at'] == '0000-00-00 00:00:00') {
|
} else if ($job['finished_at'] == '0000-00-00 00:00:00') {
|
||||||
$var['status'] = 'running';
|
$job['status'] = 'running';
|
||||||
} else {
|
} else {
|
||||||
$var['status'] = 'complete';
|
$job['status'] = 'complete';
|
||||||
}
|
}
|
||||||
return $var;
|
|
||||||
}, $job);
|
return $job;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user