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'];