|
|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace v1\controllers;
|
|
|
|
|
|
+use app\models\EventoResumenDependencia;
|
|
|
use common\data\Respuesta;
|
|
|
use common\rest\JsonController;
|
|
|
use yii\db\Expression;
|
|
|
@@ -12,14 +13,25 @@ class EventoResumenController extends JsonController {
|
|
|
public $modelName = "EventoResumen";
|
|
|
|
|
|
public function actionIndex() {
|
|
|
- $id = intval($this->req->get("id", ""));
|
|
|
- $q = trim($this->req->get("q", ""));
|
|
|
+ $clave = trim($this->req->get("clave", ""));
|
|
|
|
|
|
- $query = $this->queryInicial;
|
|
|
|
|
|
- if($id > 0) {
|
|
|
- $query->andWhere(["id" => $id]);
|
|
|
+ $modelo = EventoResumenDependencia::find()
|
|
|
+ ->andWhere(['clave' => $clave])
|
|
|
+ ->one();
|
|
|
+
|
|
|
+ if ($modelo === null) {
|
|
|
+ return (new Respuesta())
|
|
|
+ ->esError()
|
|
|
+ ->mensaje("Clave no válida");
|
|
|
}
|
|
|
+
|
|
|
+ $query = $this->queryInicial
|
|
|
+ ->andWhere([
|
|
|
+ 'idEventoResumen' => $modelo->idEventoResumen,
|
|
|
+ 'idDependencia' => $modelo->idDependencia
|
|
|
+ ]);
|
|
|
+
|
|
|
return new Respuesta($query, $this->limite, $this->pagina, $this->ordenar);
|
|
|
}
|
|
|
-}
|
|
|
+}
|