Stable without período in autidoría
This commit is contained in:
@@ -22,12 +22,27 @@ try {
|
||||
}
|
||||
});
|
||||
|
||||
$data = $db->query("SELECT *, horario_view.facultad_id, horario_view.periodo_id FROM registro
|
||||
JOIN horario_view USING (horario_id)
|
||||
LEFT JOIN estado_supervisor USING (estado_supervisor_id)
|
||||
LEFT JOIN profesor USING (profesor_id)
|
||||
LEFT JOIN usuario ON usuario.usuario_id = registro.supervisor_id
|
||||
ORDER BY registro_fecha_ideal DESC, horario_hora ASC, registro_fecha_supervisor ASC");
|
||||
$data = $db->query(
|
||||
"WITH horarios AS (
|
||||
SELECT * FROM horario_view WHERE (periodo_id, facultad_id) = (:periodo_id, :facultad_id)
|
||||
),
|
||||
fechas AS (
|
||||
SELECT fechas_clase(h.horario_id) as registro_fecha_ideal, h.horario_id
|
||||
FROM horarios h
|
||||
)
|
||||
SELECT estado_supervisor.*, usuario.*, registro.*, profesor.*, horarios.*, fechas.*
|
||||
FROM horarios
|
||||
JOIN fechas using (horario_id)
|
||||
JOIN horario_profesor using (horario_id)
|
||||
JOIN profesor using (profesor_id)
|
||||
LEFT JOIN registro USING (horario_id, registro_fecha_ideal, profesor_id)
|
||||
left join estado_supervisor using (estado_supervisor_id)
|
||||
LEFT JOIN USUARIO ON USUARIO.usuario_id = REGISTRO.supervisor_id",
|
||||
[
|
||||
':periodo_id' => $_GET['periodo_id'],
|
||||
':facultad_id' => $_GET['facultad_id'],
|
||||
]
|
||||
);
|
||||
|
||||
$last_query = [
|
||||
'query' => $db->getLastQuery(),
|
||||
@@ -46,7 +61,7 @@ try {
|
||||
echo json_encode([
|
||||
'error' => $th->getMessage(),
|
||||
'query' => $db->getLastQuery(),
|
||||
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_PARTIAL_OUTPUT_ON_ERROR);
|
||||
exit;
|
||||
} catch (Exception $th) {
|
||||
http_response_code(500);
|
||||
|
||||
Reference in New Issue
Block a user