Merge branch 'mod/userList' into 'main'

añadida columna cliente a la lista de usuarios

See merge request jjimenez/safekat!438
This commit is contained in:
2024-12-15 10:00:54 +00:00
4 changed files with 9 additions and 3 deletions

View File

@ -52,6 +52,8 @@ return [
'editor' => 'Editor', 'editor' => 'Editor',
'beta' => 'Beta', 'beta' => 'Beta',
'cliente' => 'Cliente',
'errors' => [ 'errors' => [
'cliente_sin_clienteID' => 'El usuario debe de tener un cliente asignado cuando se usa algún rol de cliente.', 'cliente_sin_clienteID' => 'El usuario debe de tener un cliente asignado cuando se usa algún rol de cliente.',
], ],

View File

@ -27,7 +27,8 @@ class UserModel extends ShieldUserModel
1 => "t1.first_name", 1 => "t1.first_name",
2 => "t1.last_name", 2 => "t1.last_name",
3 => "t2.secret", 3 => "t2.secret",
4 => "t1.last_active", 4 => "t3.nombre",
5 => "t1.last_active",
]; ];
protected $returnType = UsersEntity::class; protected $returnType = UsersEntity::class;
@ -79,10 +80,12 @@ class UserModel extends ShieldUserModel
->table($this->table . " t1") ->table($this->table . " t1")
->select( ->select(
"t1.id as id, t1.first_name AS first_name, t1.last_name AS last_name, "t1.id as id, t1.first_name AS first_name, t1.last_name AS last_name,
t2.secret AS email, t1.last_active AS last_active" t2.secret AS email, t1.last_active AS last_active, t3.nombre AS cliente"
); );
$builder->join("auth_identities t2", "t1.id = t2.user_id", "left"); $builder->join("auth_identities t2", "t1.id = t2.user_id", "left");
$builder->join("clientes t3", "t1.cliente_id = t3.id", "left");
$builder->where('t1.deleted_at', null)->groupBy("t1.id"); $builder->where('t1.deleted_at', null)->groupBy("t1.id");
if (empty($search)) if (empty($search))

View File

@ -21,6 +21,7 @@
<th><?= lang('Users.firstName') ?></th> <th><?= lang('Users.firstName') ?></th>
<th><?= lang('Users.lastName') ?></th> <th><?= lang('Users.lastName') ?></th>
<th><?= lang('Users.email') ?></th> <th><?= lang('Users.email') ?></th>
<th><?= lang('Users.cliente') ?></th>
<th class="noFilter"><?= lang('Users.lastAccess') ?></th> <th class="noFilter"><?= lang('Users.lastAccess') ?></th>
<th class="noFilter text-nowrap"><?= lang('Basic.global.Action') ?></th> <th class="noFilter text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr> </tr>

View File

@ -80,8 +80,8 @@ class UserList {
{ 'data': 'first_name' }, { 'data': 'first_name' },
{ 'data': 'last_name' }, { 'data': 'last_name' },
{ 'data': 'email' }, { 'data': 'email' },
{ 'data': 'cliente' },
{ 'data': 'last_active' }, { 'data': 'last_active' },
]; ];
const actions = ['edit', 'delete']; const actions = ['edit', 'delete'];