mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en direcciones!
This commit is contained in:
@ -63,6 +63,27 @@ class Presupuestomanipulados extends \App\Controllers\BaseResourceController
|
||||
return $this->respond($data);
|
||||
}
|
||||
|
||||
public function getServicioSolapas(){
|
||||
|
||||
if($this->request->isAJAX()){
|
||||
|
||||
$servicio = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('servicio_solapas')->value;
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
|
||||
$data = [
|
||||
'service' => $servicio,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
|
||||
return $this->respond($data);
|
||||
}
|
||||
else{
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function update($requestedId = null)
|
||||
{
|
||||
|
||||
@ -70,23 +91,23 @@ class Presupuestomanipulados extends \App\Controllers\BaseResourceController
|
||||
return;
|
||||
endif;
|
||||
|
||||
$postData = $this->request->getJSON();
|
||||
$tarifas = array_column($postData->datos, 'tarifa_id');
|
||||
$tirada = $postData->tirada ?? 0;
|
||||
$POD = $postData->POD ?? 0;
|
||||
$postData = $this->request->getPost();
|
||||
$tarifas = $postData['datos'] ?? [];
|
||||
$tirada = $postData['tirada'] ?? 0;
|
||||
$POD = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('POD')->value;
|
||||
$result = [];
|
||||
|
||||
if(count($tarifas)>0){
|
||||
foreach ($tarifas as $tarifa){
|
||||
$values = $this->model->getPrecioTarifa($tarifa, $tirada, $POD);
|
||||
array_push($result, $values);
|
||||
array_push($result, $values[0]);
|
||||
}
|
||||
}
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
$data = [
|
||||
'lines' => $result,
|
||||
'lineas' => $result,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user