Add count column to admin group list - Refs #1181
This commit is contained in:
parent
c9a9c6ea16
commit
c06e7a831f
|
|
@ -110,7 +110,8 @@ return [
|
|||
'list_title' => 'Manage Groups',
|
||||
'new' => 'New Administrator Group',
|
||||
'delete_confirm' => 'Do you really want to delete this administrator group?',
|
||||
'return' => 'Return to the group list'
|
||||
'return' => 'Return to the group list',
|
||||
'users_count' => 'Users'
|
||||
],
|
||||
'preferences' => [
|
||||
'not_authenticated' => 'There is no an authenticated user to load or save preferences for.'
|
||||
|
|
|
|||
|
|
@ -26,7 +26,8 @@ class UserGroup extends GroupBase
|
|||
* @var array Relations
|
||||
*/
|
||||
public $belongsToMany = [
|
||||
'users' => ['Backend\Models\User', 'table' => 'backend_users_groups']
|
||||
'users' => ['Backend\Models\User', 'table' => 'backend_users_groups'],
|
||||
'users_count' => ['Backend\Models\User', 'table' => 'backend_users_groups', 'count' => true]
|
||||
];
|
||||
|
||||
public function afterCreate()
|
||||
|
|
|
|||
|
|
@ -9,4 +9,10 @@ columns:
|
|||
|
||||
description:
|
||||
label: backend::lang.user.group.description_field
|
||||
searchable: yes
|
||||
searchable: yes
|
||||
|
||||
users_count:
|
||||
label: backend::lang.user.group.users_count
|
||||
relation: users_count
|
||||
valueFrom: count
|
||||
default: 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue