fixed now can drive Todos
This commit is contained in:
@@ -1161,7 +1161,7 @@ export class EquipoService {
|
||||
})
|
||||
}
|
||||
|
||||
if (filtros?.antiguedad?.length) {
|
||||
if (filtros?.antiguedad?.length && !filtros.antiguedad.includes("Todos")) {
|
||||
qb.andWhere('equipo.antiguedad IN (:...antiguedad)', {
|
||||
antiguedad: filtros.antiguedad
|
||||
})
|
||||
@@ -1218,7 +1218,13 @@ export class EquipoService {
|
||||
|
||||
}
|
||||
|
||||
qb.orderBy(`equipo.adscripcion`, "ASC")
|
||||
qb.orderBy(`
|
||||
CASE
|
||||
WHEN tipoUso.tipo_uso = 'ALUMNO' THEN 1
|
||||
WHEN tipoUso.tipo_uso = 'PROFESOR' THEN 2
|
||||
WHEN tipoUso.tipo_uso = 'ADMINISTRATIVO' THEN 3
|
||||
WHEN tipoUso.tipo_uso = 'TÉCNICO ACADEMICO' THEN 4
|
||||
END`)
|
||||
|
||||
break
|
||||
|
||||
@@ -1283,7 +1289,7 @@ export class EquipoService {
|
||||
qb.addSelect('adscripcion.adscripcion', 'adscripcion')
|
||||
qb.addSelect('equipo.lugar', 'ubicacion')
|
||||
|
||||
const tieneFiltroReal = (arr?: string[]) => arr?.length && !arr.includes("0")
|
||||
const tieneFiltroReal = (arr?: string[]) => arr?.length && !arr.includes("0") && !arr.includes("Todos")
|
||||
|
||||
console.log(filtros)
|
||||
|
||||
@@ -1293,7 +1299,6 @@ export class EquipoService {
|
||||
// siempre selecciona
|
||||
qb.addSelect('adscripcion.adscripcion', 'adscripcion')
|
||||
|
||||
// solo filtra si no es "Todos"
|
||||
if (tieneFiltroReal(filtros.adscripciones)) {
|
||||
qb.andWhere('adscripcion.id_adscripcion IN (:...adscripciones)', {
|
||||
adscripciones: filtros.adscripciones
|
||||
@@ -1389,7 +1394,7 @@ export class EquipoService {
|
||||
})
|
||||
}
|
||||
|
||||
if (filtros?.antiguedad?.length) {
|
||||
if (filtros?.antiguedad?.length && !filtros.antiguedad.includes("Todos")) {
|
||||
qb.andWhere('equipo.antiguedad IN (:...antiguedad)', {
|
||||
antiguedad: filtros.antiguedad
|
||||
})
|
||||
@@ -1416,7 +1421,7 @@ export class EquipoService {
|
||||
qb.addSelect('adscripcion.adscripcion', 'adscripcion');
|
||||
qb.addSelect('equipo.lugar', 'ubicacion');
|
||||
|
||||
const tieneFiltroReal = (arr?: string[]) => arr?.length && !arr.includes("0");
|
||||
const tieneFiltroReal = (arr?: string[]) => arr?.length && !arr.includes("0") && !arr.includes("Todos");
|
||||
|
||||
// ADSCRIPCIONES
|
||||
if (filtros?.adscripciones?.length) {
|
||||
@@ -1553,7 +1558,7 @@ export class EquipoService {
|
||||
});
|
||||
}
|
||||
|
||||
if (filtros?.antiguedad?.length) {
|
||||
if (filtros?.antiguedad?.length && !filtros.antiguedad.includes("Todos")) {
|
||||
qb.andWhere('equipo.antiguedad IN (:...antiguedad)', {
|
||||
antiguedad: filtros.antiguedad
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user