mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
feat delete portada and remove loader
This commit is contained in:
@ -253,6 +253,22 @@ class Ordentrabajo extends BaseController
|
||||
return $this->response->setJSON(["message" => "Portada error", "error" => $th->getMessage()])->setStatusCode($th->getCode());
|
||||
}
|
||||
}
|
||||
public function delete_orden_trabajo_portada($orden_trabajo_id)
|
||||
{
|
||||
try {
|
||||
helper('filesystem');
|
||||
$otEntity = $this->otModel->find($orden_trabajo_id);
|
||||
$pathActualFile = $otEntity->portada_path;
|
||||
$fullPath = WRITEPATH . 'uploads/' . $pathActualFile;
|
||||
if(file_exists($fullPath)){
|
||||
delete_files($fullPath);
|
||||
}
|
||||
$r = $this->otModel->update($otEntity->id, ["portada_path" => null]);
|
||||
return $this->response->setJSON(["message" => "Portada eliminada", "data" => $r]);
|
||||
} catch (\Throwable $th) {
|
||||
return $this->response->setStatusCode(500)->setJSON(["message" => "Portada error", "error" => $th->getMessage()]);
|
||||
}
|
||||
}
|
||||
public function get_portada_img($orden_trabajo_id)
|
||||
{
|
||||
$ot = $this->otModel->find($orden_trabajo_id);
|
||||
@ -287,4 +303,25 @@ class Ordentrabajo extends BaseController
|
||||
->add("action", fn($q) => $q)
|
||||
->toJson(true);
|
||||
}
|
||||
public function select_maquina_planning_rot(){
|
||||
$q = $this->request->getGet('q');
|
||||
$result = $this->produccionService->querySelectMaquinaPlanningRotativa($q);
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
public function select_papel_planning_rot(){
|
||||
$q = $this->request->getGet('q');
|
||||
$result = $this->produccionService->querySelectPapelPlanningRot($q);
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
public function select_maquina_planning_plana(){
|
||||
$q = $this->request->getGet('q');
|
||||
$result = $this->produccionService->querySelectMaquinaPlanningPlana($q);
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
public function select_papel_planning_plana(){
|
||||
$q = $this->request->getGet('q');
|
||||
$result = $this->produccionService->querySelectPapelPlanningPlana($q);
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user