$limit, 'offset' => $offset, 'search' => $search, 'order' => $order, 'dir' => $dir, 'active' => $active, ]); $defaultRoleId = SettingService::getDefaultRoleId(); $rows = []; foreach ($result['rows'] as $row) { $roleId = (int) ($row['id'] ?? 0); $rows[] = [ 'id' => $row['id'] ?? null, 'uuid' => $row['uuid'] ?? '', 'is_default' => $roleId > 0 && $defaultRoleId === $roleId, 'description' => $row['description'] ?? '', 'code' => $row['code'] ?? '', 'active' => (int) ($row['active'] ?? 1), 'created' => dt($row['created'] ?? ''), 'modified' => dt($row['modified'] ?? ''), ]; } Router::json([ 'data' => $rows, 'total' => $result['total'] ?? 0, ]);