public function getNoticiasPrev() { if (!Sesion::isAdmin()) { return Redirect::to('administracion/logout'); } /*$seleccionar = Fuentes::get() ->toArray(); */ $format = "Y-m-d"; $timestamp = time(); $fecha = date($format, $timestamp); $fechaInicio = $fecha . " 00:00:00"; $fechaFin = $fecha . " 23:59:59"; // $seleccionar=DB::select('SELECT f.fueNombre, n.notTitulo, n.notContenido, r.resNombre, n.notId FROM noticias n, fuentes f, responsables r WHERE n.notFuente = f.fueId AND n.notResponsables = r.resId AND n.notFecha >= "'.$fechaInicio.'" AND n.notFecha <= "'.$fechaFin.'" GROUP BY notId ORDER BY f.fueid;'); $seleccionar = NoticiasController::consultaNoticiasPrev($fechaInicio, $fechaFin); if (count($seleccionar) > 0) { $response = array('status' => 'OK', 'data' => $seleccionar, 'message' => 'Resultados obtenidos'); } else { $response = array('status' => 'ERROR', 'message' => 'No se encontraron noticias registradas.'); } return Response::json($response); }