mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
voy a añadir grupos de cajas
This commit is contained in:
@ -80,14 +80,14 @@ class LogisticaController extends BaseController
|
||||
];
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
$result = LogisticaService::findPedidoOrISBN($search, $envio_id);
|
||||
$result = LogisticaService::findPedidoOrISBN($search);
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
|
||||
public function selectAddEnvioLinea(){
|
||||
|
||||
if ($this->request->isAJAX()) {
|
||||
$query = LogisticaService::findLineaEnvio($this->request->getGet('direccion'))->orderBy("nombre", "asc");
|
||||
$query = LogisticaService::findLineaEnvioPorEnvio($this->request->getGet('envio'))->orderBy("name", "asc");
|
||||
if ($this->request->getGet("q")) {
|
||||
$query->groupStart()
|
||||
->orLike("pedidos.id", $this->request->getGet("q"))
|
||||
@ -95,7 +95,24 @@ class LogisticaController extends BaseController
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
return $this->response->setJSON($query->get()->getResultObject());
|
||||
$result = $query->get()->getResultObject();
|
||||
|
||||
return $this->response->setJSON($result);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function addEnvioLinea(){
|
||||
|
||||
if ($this->request->isAJAX()) {
|
||||
$pedido_id = $this->request->getGet('pedido_id');
|
||||
$envio_id = $this->request->getGet('envio_id');
|
||||
$envioModel = model('App\Models\Logistica\EnvioModel');
|
||||
$direccion = $envioModel->find($envio_id)->direccion;
|
||||
|
||||
$result = LogisticaService::addLineaEnvio($envio_id, $pedido_id, $direccion);
|
||||
return $this->response->setJSON($result);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user