mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
cambiado ael añadir envios
This commit is contained in:
@ -69,6 +69,46 @@ class LogisticaController extends BaseController
|
||||
return view(static::$viewPath . 'viewLogisticaSelectEnvios', $viewData);
|
||||
}
|
||||
|
||||
|
||||
public function findPedidosNewEnvio()
|
||||
{
|
||||
|
||||
if ($this->request->isAJAX()) {
|
||||
$query = LogisticaService::findPedidosNewEnvio();
|
||||
if ($this->request->getGet("q")) {
|
||||
$query->groupStart()
|
||||
->orLike("id", $this->request->getGet("q"))
|
||||
->orLike("name", $this->request->getGet("q"))
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
|
||||
$result = $query->orderBy("name", "asc")->get()->getResultObject();
|
||||
|
||||
return $this->response->setJSON($result);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function selectDireccionForEnvio(){
|
||||
|
||||
if ($this->request->isAJAX()) {
|
||||
$pedido_id = $this->request->getGet('pedido_id');
|
||||
if($pedido_id == null || $pedido_id == 0){
|
||||
return [];
|
||||
}
|
||||
$searchVal = $this->request->getGet("q") ?? "";
|
||||
$result = LogisticaService::findDireccionesNewEnvio($pedido_id, $searchVal);
|
||||
|
||||
return $this->response->setJSON($result);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function searchPedidoOrISBN($search = "", $envio_id = null)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user