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);
|
$status = $this->produccionService->tareaUpdateMaquinaCorte($orden_trabajo_id);
|
||||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status]);
|
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();
|
$bodyData = $this->request->getPost();
|
||||||
$files = $this->produccionService->init($bodyData["orden_trabajo_id"])->getOtFiles();
|
$files = $this->produccionService->init($bodyData["orden_trabajo_id"])->getOtFiles();
|
||||||
$response = [];
|
$response = [];
|
||||||
@ -353,9 +354,14 @@ class Ordentrabajo extends BaseController
|
|||||||
$otFiles = [];
|
$otFiles = [];
|
||||||
$bodyData = $this->request->getPost();
|
$bodyData = $this->request->getPost();
|
||||||
$files = $this->request->getFileMultiple('file');
|
$files = $this->request->getFileMultiple('file');
|
||||||
$response = $this->produccionService
|
$ps = $this->produccionService->init($bodyData["orden_trabajo_id"]);
|
||||||
->init($bodyData["orden_trabajo_id"])
|
$existingFiles = json_decode($bodyData["oldFiles"]);
|
||||||
->storeOtFiles($files);
|
$ps->deleteOtFiles($existingFiles);
|
||||||
|
if($files){
|
||||||
|
$response = $ps->storeOtFiles($files);
|
||||||
|
}else{
|
||||||
|
$response = null;
|
||||||
|
}
|
||||||
return $this->response->setJSON([
|
return $this->response->setJSON([
|
||||||
"message" => lang("App.global_alert_save_success"),
|
"message" => lang("App.global_alert_save_success"),
|
||||||
"data" => $response,
|
"data" => $response,
|
||||||
|
|||||||
Reference in New Issue
Block a user