mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
diseño interior con selector de papeles
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user