diff --git a/ci4/app/Controllers/Configuracion/Papelformato.php b/ci4/app/Controllers/Configuracion/Papelformato.php index 271bce82..b2b23276 100755 --- a/ci4/app/Controllers/Configuracion/Papelformato.php +++ b/ci4/app/Controllers/Configuracion/Papelformato.php @@ -264,19 +264,9 @@ class Papelformato extends \App\Controllers\BaseResourceController { public function getSelect2() { if ($this->request->isAJAX()) { - $query = $this->model->builder()->select( - [ - "id", - "nombre as name" - ] - )->where("deleted_at", null); - if ($this->request->getGet("q")) { - $query->groupStart() - ->orLike("clientes.nombre", $this->request->getGet("q")) - ->groupEnd(); - } - - return $this->response->setJSON($query->get()->getResultObject()); + $data = $this->model->getElementsForMenu2($this->request->getGet("q")); + + return $this->response->setJSON($data); } else { return $this->failUnauthorized('Invalid request', 403); } diff --git a/ci4/app/Models/Configuracion/PapelFormatoModel.php b/ci4/app/Models/Configuracion/PapelFormatoModel.php index d809fec6..8f54389a 100755 --- a/ci4/app/Models/Configuracion/PapelFormatoModel.php +++ b/ci4/app/Models/Configuracion/PapelFormatoModel.php @@ -98,8 +98,12 @@ class PapelFormatoModel extends \App\Models\BaseModel $builder = $this->db ->table($this->table . " t1") ->select( - "t1.id AS id, CONCAT(t1.ancho, ' x ', t1.alto) AS text" - )->where('is_deleted', 0)->orderBy('orden_select', 'asc'); + "t1.id AS id, CONCAT(t1.ancho, ' x ', t1.alto) AS name" + ) + ->where('is_deleted', 0) + ->where('id>', 0) + ->orderBy('orden_select', 'asc'); + return empty($search) ? $builder->get()->getResultObject()