mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
upload files
This commit is contained in:
@ -332,7 +332,8 @@ class Ordentrabajo extends BaseController
|
||||
$status = $this->produccionService->tareaUpdateMaquinaCorte($orden_trabajo_id);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status]);
|
||||
}
|
||||
public function get_files() {
|
||||
public function get_files()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
$files = $this->produccionService->init($bodyData["orden_trabajo_id"])->getOtFiles();
|
||||
$response = [];
|
||||
@ -353,9 +354,14 @@ class Ordentrabajo extends BaseController
|
||||
$otFiles = [];
|
||||
$bodyData = $this->request->getPost();
|
||||
$files = $this->request->getFileMultiple('file');
|
||||
$response = $this->produccionService
|
||||
->init($bodyData["orden_trabajo_id"])
|
||||
->storeOtFiles($files);
|
||||
$ps = $this->produccionService->init($bodyData["orden_trabajo_id"]);
|
||||
$existingFiles = json_decode($bodyData["oldFiles"]);
|
||||
$ps->deleteOtFiles($existingFiles);
|
||||
if($files){
|
||||
$response = $ps->storeOtFiles($files);
|
||||
}else{
|
||||
$response = null;
|
||||
}
|
||||
return $this->response->setJSON([
|
||||
"message" => lang("App.global_alert_save_success"),
|
||||
"data" => $response,
|
||||
|
||||
Reference in New Issue
Block a user