You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.7 KiB
PHP
71 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
use App\Models\ProcesoAdmision;
|
|
use App\Models\ProcesoAdmisionDetalle;
|
|
|
|
class WebController extends Controller
|
|
{
|
|
|
|
public function GetProcesoAdmision()
|
|
{
|
|
$procesos = ProcesoAdmision::select(
|
|
'id',
|
|
'titulo',
|
|
'subtitulo',
|
|
'descripcion',
|
|
'slug',
|
|
'tipo_proceso',
|
|
'modalidad',
|
|
'publicado',
|
|
'fecha_publicacion',
|
|
'fecha_inicio_preinscripcion',
|
|
'fecha_fin_preinscripcion',
|
|
'fecha_inicio_inscripcion',
|
|
'fecha_fin_inscripcion',
|
|
'fecha_examen1',
|
|
'fecha_examen2',
|
|
'fecha_resultados',
|
|
'fecha_inicio_biometrico',
|
|
'fecha_fin_biometrico',
|
|
'imagen_path',
|
|
'banner_path',
|
|
'brochure_path',
|
|
'link_preinscripcion',
|
|
'link_inscripcion',
|
|
'link_resultados',
|
|
'link_reglamento',
|
|
'estado',
|
|
'created_at',
|
|
'updated_at'
|
|
)
|
|
->with([
|
|
'detalles' => function ($query) {
|
|
$query->select(
|
|
'id',
|
|
'proceso_admision_id',
|
|
'tipo',
|
|
'titulo_detalle',
|
|
'descripcion',
|
|
'listas',
|
|
'meta',
|
|
'url',
|
|
'imagen_path',
|
|
'imagen_path_2',
|
|
'created_at',
|
|
'updated_at'
|
|
);
|
|
}
|
|
])
|
|
->latest() // 🔥 Esto ordena por created_at DESC
|
|
->get();
|
|
|
|
return response()->json([
|
|
'success' => true,
|
|
'data' => $procesos
|
|
]);
|
|
}
|
|
|
|
|
|
}
|