Преглед изворни кода

cambios a consulta de fechas para resumen y dependencia

Isaac Noriega пре 2 година
родитељ
комит
2a22f5b7a6
1 измењених фајлова са 29 додато и 0 уклоњено
  1. 29 0
      modules/v1/controllers/EventoResumenController.php

+ 29 - 0
modules/v1/controllers/EventoResumenController.php

@@ -58,4 +58,33 @@ class EventoResumenController extends JsonController {
 
     return new Respuesta($query, $this->limite, $this->pagina, $this->ordenar);
   }
+
+  public function actionConsulta() {
+    $c = $this->req->get("c", "");
+    $d = $this->req->get("d", "");
+
+    $modelo = null;
+    if ($d !== "") {
+      $temp = EventoResumenDependencia::find()
+        ->andWhere(['clave' => $d])
+        ->one();
+      if ($temp !== null) {
+        $modelo = $temp->eventoResumen;
+      }
+    }
+
+    if ($c !== "") {
+      $modelo = EventoResumen::find()
+        ->andWhere(['uuid' => $c])
+        ->one();
+    }
+
+    if ($modelo === null) {
+      return (new Respuesta())
+        ->esError()
+        ->mensaje("ID no válida");
+    }
+
+    return new Respuesta($modelo);
+  }
 }