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) {
|
||||
$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') {
|
||||
$var['status'] = 'pending';
|
||||
} else if ($var['finished_at'] == '0000-00-00 00:00:00') {
|
||||
$var['status'] = 'running';
|
||||
} else {
|
||||
$var['status'] = 'complete';
|
||||
}
|
||||
return $var;
|
||||
}, $job);
|
||||
|
||||
if ($job['started_at'] == '0000-00-00 00:00:00') {
|
||||
$job['status'] = 'pending';
|
||||
} else if ($job['finished_at'] == '0000-00-00 00:00:00') {
|
||||
$job['status'] = 'running';
|
||||
} else {
|
||||
$job['status'] = 'complete';
|
||||
}
|
||||
|
||||
return $job;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user