diseño interior con selector de papeles

This commit is contained in:
2024-11-24 20:03:42 +01:00
parent b42b34f350
commit bcbf14c41f
22 changed files with 693 additions and 767 deletions

View File

@ -318,11 +318,6 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
}
/******************************************
*
* AUQIIIIII
*/
public function selectPapelEspecial()
{
@ -330,21 +325,16 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
$tipo = goSanitize($this->request->getGet('tipo'))[0];
$cubierta = goSanitize($this->request->getGet('cubierta'))[0] ?? 0;
$items = $this->model->getPapelCliente($tipo, $cubierta, null, true);
$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());
$items = $this->model->getPapelCliente($tipo, $cubierta, null, true);
$items = array_map(function ($item) {
return [
'id' => $item->id,
'name' => $item->nombre
];
}, $items);
return $this->response->setJSON($items);
} else {
return $this->failUnauthorized('Invalid request', 403);
}