mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en el form
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user