forked from Public/pics
Management controllers: move table queries into models
This commit is contained in:
@@ -100,20 +100,7 @@ class ManageUsers extends HTMLController
|
||||
'items_per_page' => 30,
|
||||
'index_class' => 'col-md-6',
|
||||
'base_url' => BASEURL . '/manageusers/',
|
||||
'get_data' => function($offset, $limit, $order, $direction) {
|
||||
assert(in_array($order, ['id_user', 'surname', 'first_name', 'slug', 'emailaddress', 'last_action_time', 'ip_address', 'is_admin']));
|
||||
|
||||
return Registry::get('db')->queryAssocs('
|
||||
SELECT *
|
||||
FROM users
|
||||
ORDER BY {raw:order}
|
||||
LIMIT {int:offset}, {int:limit}',
|
||||
[
|
||||
'order' => $order . ($direction == 'up' ? ' ASC' : ' DESC'),
|
||||
'offset' => $offset,
|
||||
'limit' => $limit,
|
||||
]);
|
||||
},
|
||||
'get_data' => 'Member::getOffset',
|
||||
'get_count' => 'Member::getCount',
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user