feat: actualizar lógica de filtrado de usuarios y establecer tipo de usuario por defecto en creación
This commit is contained in:
+2
-2
@@ -76,8 +76,8 @@ func AllUsersSistema(limit, offset int, search string) ([]Users, int64, error) {
|
||||
db = db.Where("name LIKE ? OR nombre_usuario LIKE ?", "%"+search+"%", "%"+search+"%")
|
||||
}
|
||||
|
||||
// Filtrar por tipo_usuario = 'sistema'
|
||||
db = db.Where("tipo_usuario = ?", "sistema")
|
||||
// Filtrar por tipo_usuario = 'sistema' o vacío (excluye usuarios 'gas' y otros tipos)
|
||||
db = db.Where("tipo_usuario = ? OR tipo_usuario = '' OR tipo_usuario IS NULL", "sistema")
|
||||
|
||||
// Obtener el total de usuarios
|
||||
if err := db.Count(&total).Error; err != nil {
|
||||
|
||||
Reference in New Issue
Block a user