|
@@ -13,6 +13,7 @@ class BannerController extends AuthController {
|
|
|
public function actionIndex() {
|
|
|
$id = trim($this->req->get("id", ""));
|
|
|
$buscar = trim($this->req->get("q", ""));
|
|
|
+ $campana = trim($this->req->get("idCampana", ""));
|
|
|
|
|
|
$query = $this->queryInicial;
|
|
|
|
|
@@ -20,12 +21,17 @@ class BannerController extends AuthController {
|
|
|
$query->andWhere(["id" => $id]);
|
|
|
}
|
|
|
|
|
|
+ if ($campana !== "") {
|
|
|
+ $query->andWhere(["idCampana" => $campana]);
|
|
|
+ }
|
|
|
+
|
|
|
if($buscar) {
|
|
|
|
|
|
$query->andWhere([
|
|
|
"OR",
|
|
|
- ["ilike", "nombre", $buscar]
|
|
|
- ]);
|
|
|
+ "f_unaccent([[nombre]]) ilike f_unaccent(:q)",
|
|
|
+ "f_unaccent([[descripcion]]) ilike f_unaccent(:q)",
|
|
|
+ ])->addParams([':q' => "%{$buscar}%"]);
|
|
|
|
|
|
}
|
|
|
|