public function listAction() { $data = $this->_tManager->getList(); if (!empty($data)) { $dict = Dictionary::getInstance('task'); foreach ($data as $k => &$v) { $v['status_code'] = $v['status']; if ($dict->isValidKey($v['status'])) { $v['status'] = $dict->getValue($v['status']); } $finish = strtotime($v['time_finished']); if ($finish <= 0) { $finish = time(); } $v['runtime'] = Utils::formatTime($finish - strtotime($v['time_started'])); $v['memory'] = Utils::formatFileSize($v['memory']); $v['memory_peak'] = Utils::formatFileSize($v['memory_peak']); if ($v['op_total'] == 0) { $v['progress'] = 0; } else { $v['progress'] = number_format($v['op_finished'] / $v['op_total'], 2) * 100; } } unset($v); } Response::jsonSuccess($data); }