big restructure
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
use MintyPHP\Router;
|
||||
use MintyPHP\Support\Guard;
|
||||
use MintyPHP\Service\RoleService;
|
||||
use MintyPHP\Service\SettingService;
|
||||
use MintyPHP\Service\PermissionService;
|
||||
use MintyPHP\Service\Access\RoleService;
|
||||
use MintyPHP\Service\Settings\SettingService;
|
||||
use MintyPHP\Service\Access\PermissionService;
|
||||
|
||||
Guard::requireLogin();
|
||||
Guard::requirePermission(PermissionService::ROLES_VIEW);
|
||||
@@ -14,6 +14,7 @@ $offset = (int) ($_GET['offset'] ?? 0);
|
||||
$search = trim((string) ($_GET['search'] ?? ''));
|
||||
$order = (string) ($_GET['order'] ?? 'description');
|
||||
$dir = (string) ($_GET['dir'] ?? 'asc');
|
||||
$active = (string) ($_GET['active'] ?? '');
|
||||
|
||||
$result = RoleService::listPaged([
|
||||
'limit' => $limit,
|
||||
@@ -21,6 +22,7 @@ $result = RoleService::listPaged([
|
||||
'search' => $search,
|
||||
'order' => $order,
|
||||
'dir' => $dir,
|
||||
'active' => $active,
|
||||
]);
|
||||
|
||||
$defaultRoleId = SettingService::getDefaultRoleId();
|
||||
@@ -32,6 +34,8 @@ foreach ($result['rows'] as $row) {
|
||||
'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'] ?? ''),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user