trabajando en pedidos 3

This commit is contained in:
jaimejimenezortega
2024-06-13 23:53:20 +02:00
parent b1734e169b
commit c9d8875392
12 changed files with 418 additions and 83 deletions

View File

@ -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;
}
}