mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en pedidos 3
This commit is contained in:
@ -67,4 +67,22 @@ class PedidoModel extends \App\Models\BaseModel
|
||||
|
||||
return $builder->get()->getResultObject();
|
||||
}
|
||||
|
||||
public function obtenerLineasPedido($pedido_id){
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t2.presupuesto_id"
|
||||
);
|
||||
$builder->where("t1.id", $pedido_id);
|
||||
$builder->join("pedidos_linea t2", "t2.pedido_id = t1.id", "left");
|
||||
$model_presupuesto = model("App\Models\Presupuestos\PresupuestoModel");
|
||||
$lineasPresupuesto = [];
|
||||
|
||||
foreach($builder->get()->getResultObject() as $row){
|
||||
array_push($lineasPresupuesto, $model_presupuesto->generarLineaPedido($row->presupuesto_id)[0]);
|
||||
}
|
||||
|
||||
return $lineasPresupuesto;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user