trabajando en el form

This commit is contained in:
2024-06-13 19:23:50 +02:00
parent e491172b28
commit b1734e169b
7 changed files with 339 additions and 19 deletions

View File

@ -53,4 +53,18 @@ class PedidoModel extends \App\Models\BaseModel
public static $labelField = "id";
public function obtenerDatosForm($pedido_id){
$builder = $this->db
->table($this->table . " t1")
->select(
"t4.id AS cliente_id, t4.nombre AS cliente, CONCAT(t5.first_name, ' ', t5.last_name) AS comercial");
$builder->join("pedidos_linea t2", "t2.pedido_id = t1.id", "left");
$builder->join("presupuestos t3", "t2.presupuesto_id = t3.id", "left");
$builder->join("clientes t4", "t4.id = t3.cliente_id", "left");
$builder->join("users t5", "t5.id = t4.comercial_id", "left");
return $builder->get()->getResultObject();
}
}