public function indexAction() { $user = $this->session->getCurrentUser(); $projectsModel = new Projects(); $stat = $projectsModel->getProjectsStat((int) $user->id); foreach ($stat as &$item) { if ($item['t_sum'] === null) { $item['t_sum'] = 'Не работали'; } else { $hours = floor($item['t_sum'] / 3600); $mins = floor(($item['t_sum'] - $hours * 3600) / 60); $item['t_sum'] = $hours . ' часов ' . $mins . ' минут'; } } $this->view->stat = $stat; }