|
@@ -11,23 +11,23 @@ class TallerController extends AuthController {
|
|
public $modelClass = "v1\models\Taller";
|
|
public $modelClass = "v1\models\Taller";
|
|
|
|
|
|
public function actionIndex() {
|
|
public function actionIndex() {
|
|
- $id = intval($this->req->get("id", ""));
|
|
|
|
|
|
+ $id = trim($this->req->get("id", ""));
|
|
$buscar = trim($this->req->get("q", ""));
|
|
$buscar = trim($this->req->get("q", ""));
|
|
-
|
|
|
|
|
|
+
|
|
$query = $this->queryInicial;
|
|
$query = $this->queryInicial;
|
|
|
|
+
|
|
|
|
|
|
- if($id > 0) {
|
|
|
|
|
|
+ if($id !== "") {
|
|
$query->andWhere(["id" => $id]);
|
|
$query->andWhere(["id" => $id]);
|
|
}
|
|
}
|
|
|
|
|
|
if($buscar) {
|
|
if($buscar) {
|
|
- # Ejemplo de buscador
|
|
|
|
|
|
|
|
$query->andWhere([
|
|
$query->andWhere([
|
|
"OR",
|
|
"OR",
|
|
["ilike", "nombre", $buscar]
|
|
["ilike", "nombre", $buscar]
|
|
]);
|
|
]);
|
|
- //
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
return new Respuesta($query, $this->limite, $this->pagina, $this->ordenar);
|
|
return new Respuesta($query, $this->limite, $this->pagina, $this->ordenar);
|