Se modifico la confirmacion del alumno
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
Post,
|
||||
} from '@nestjs/common';
|
||||
import { InscripcionDscService } from './inscripcion-dsc.service';
|
||||
import { And } from 'typeorm';
|
||||
|
||||
@Controller('inscripcion-dsc')
|
||||
export class InscripcionDscController {
|
||||
@@ -29,7 +30,7 @@ export class InscripcionDscController {
|
||||
|
||||
try{
|
||||
/* console.log("verificando confirmacion:", userInformation);
|
||||
*/ if (userInformation[0].confirmacion) {
|
||||
*/ if (userInformation[0].confirmacion && userInformation[1].confirmacion) {
|
||||
return {
|
||||
error: true,
|
||||
msj: 'El usuario ya hizo la confirmación anteriormente',
|
||||
|
||||
@@ -12,8 +12,12 @@ export class InscripcionDscService {
|
||||
database: process.env.DB_NAME_DSC,
|
||||
});
|
||||
|
||||
// const userInformationQuery = `SELECT A.id_cuenta, nombre, if(AI.platica=true,1,0) as confirmacion FROM alumno A
|
||||
// JOIN alumno_inscrito AI ON (A.id_cuenta = AI.id_cuenta)
|
||||
// JOIN periodo P ON (P.id_periodo = AI.id_periodo)
|
||||
// WHERE A.id_cuenta = "${accountNumber}" and P.activo=true`;
|
||||
const userInformationQuery = `SELECT A.id_cuenta, nombre, if(AI.platica=true,1,0) as confirmacion FROM alumno A
|
||||
JOIN alumno_inscrito AI ON (A.id_cuenta = AI.id_cuenta)
|
||||
JOIN alumno_inscrito AI ON (A.id_cuenta = AI.id_cuenta) and (AI.id_plataforma = 1 || AI.id_plataforma = 2)
|
||||
JOIN periodo P ON (P.id_periodo = AI.id_periodo)
|
||||
WHERE A.id_cuenta = "${accountNumber}" and P.activo=true`;
|
||||
|
||||
@@ -23,6 +27,7 @@ export class InscripcionDscService {
|
||||
const resultsArray = JSON.parse(JSON.stringify(results));
|
||||
if (resultsArray.length === 0) return null;
|
||||
/* console.log('The solution is: ', resultsArray); */
|
||||
console.log('The solution is: ', resultsArray);
|
||||
|
||||
return results;
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user