problema ruta papelformato

This commit is contained in:
2024-10-14 18:19:41 +02:00
parent 52303e9185
commit 668d0d79e6
5 changed files with 41 additions and 16 deletions

View File

@ -1,4 +1,6 @@
<?php namespace App\Controllers\Clientes;
<?php
namespace App\Controllers\Clientes;
@ -152,7 +154,7 @@ class Cliente extends \App\Controllers\BaseResourceController
return $this->redirect2listView('sweet-error', $message);
endif;
if ($this->request->getPost()) :
@ -310,10 +312,9 @@ class Cliente extends \App\Controllers\BaseResourceController
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
$onlyActiveOnes = false;
try{
try {
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
}
catch(Exception $e){
} catch (Exception $e) {
$menu = [];
}
@ -339,15 +340,13 @@ class Cliente extends \App\Controllers\BaseResourceController
"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());
// return $this->respond($menu);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
@ -447,24 +446,23 @@ class Cliente extends \App\Controllers\BaseResourceController
}
protected function getPrecioTemplate($cliente_id){
protected function getPrecioTemplate($cliente_id)
{
$modelPreciosCliente = model('App\Models\Clientes\ClientePreciosModel');
$plantilla_id = $modelPreciosCliente->get_plantilla_precios($cliente_id);
if (is_null($plantilla_id)){
if (is_null($plantilla_id)) {
return null;
}
$modelPlantillaPreciosCliente = model('App\Models\Clientes\ClientePlantillaPreciosModel');
$plantilla = $modelPlantillaPreciosCliente->where("id", $plantilla_id)->where("is_deleted", 0)->first();
if ($plantilla == false){
if ($plantilla == false) {
return null;
}
else{
} else {
return (object)array(
"value" => $plantilla_id,
"label" => $plantilla->nombre
);
}
}
}