From 721eb445dcbd1cfde888a664593bb781c1d563f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= Date: Sun, 15 Dec 2024 11:00:28 +0100 Subject: [PATCH] =?UTF-8?q?a=C3=B1adida=20columna=20cliente=20a=20la=20lis?= =?UTF-8?q?ta=20de=20usuarios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ci4/app/Language/es/Users.php | 2 ++ ci4/app/Models/UserModel.php | 7 +++++-- ci4/app/Views/themes/vuexy/form/user/viewUserList.php | 1 + httpdocs/assets/js/safekat/pages/users/list.js | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ci4/app/Language/es/Users.php b/ci4/app/Language/es/Users.php index ff61a685..620aa2df 100755 --- a/ci4/app/Language/es/Users.php +++ b/ci4/app/Language/es/Users.php @@ -52,6 +52,8 @@ return [ 'editor' => 'Editor', 'beta' => 'Beta', + 'cliente' => 'Cliente', + 'errors' => [ 'cliente_sin_clienteID' => 'El usuario debe de tener un cliente asignado cuando se usa algĂșn rol de cliente.', ], diff --git a/ci4/app/Models/UserModel.php b/ci4/app/Models/UserModel.php index 154df39a..e8b34efe 100644 --- a/ci4/app/Models/UserModel.php +++ b/ci4/app/Models/UserModel.php @@ -27,7 +27,8 @@ class UserModel extends ShieldUserModel 1 => "t1.first_name", 2 => "t1.last_name", 3 => "t2.secret", - 4 => "t1.last_active", + 4 => "t3.nombre", + 5 => "t1.last_active", ]; protected $returnType = UsersEntity::class; @@ -79,10 +80,12 @@ class UserModel extends ShieldUserModel ->table($this->table . " t1") ->select( "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("clientes t3", "t1.cliente_id = t3.id", "left"); + $builder->where('t1.deleted_at', null)->groupBy("t1.id"); if (empty($search)) diff --git a/ci4/app/Views/themes/vuexy/form/user/viewUserList.php b/ci4/app/Views/themes/vuexy/form/user/viewUserList.php index f142c4f1..e72c8c3f 100644 --- a/ci4/app/Views/themes/vuexy/form/user/viewUserList.php +++ b/ci4/app/Views/themes/vuexy/form/user/viewUserList.php @@ -21,6 +21,7 @@ + diff --git a/httpdocs/assets/js/safekat/pages/users/list.js b/httpdocs/assets/js/safekat/pages/users/list.js index d5a4094c..0d2442a4 100644 --- a/httpdocs/assets/js/safekat/pages/users/list.js +++ b/httpdocs/assets/js/safekat/pages/users/list.js @@ -80,8 +80,8 @@ class UserList { { 'data': 'first_name' }, { 'data': 'last_name' }, { 'data': 'email' }, + { 'data': 'cliente' }, { 'data': 'last_active' }, - ]; const actions = ['edit', 'delete'];