mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en el formulario envio de ferros
This commit is contained in:
@ -32,13 +32,14 @@ class EnvioModel extends Model
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'cajas',
|
||||
'tipo_envio',
|
||||
];
|
||||
|
||||
protected $useTimestamps = true;
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
|
||||
public function getDatatableQuery(): BaseBuilder
|
||||
public function getDatatableQuery($tipo_envio = "estandar"): BaseBuilder
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
@ -51,6 +52,24 @@ class EnvioModel extends Model
|
||||
$builder->join("lg_paises t3", "t3.id = t1.pais_id", "left");
|
||||
$builder->join("pedidos t4", "t4.id = t2.pedido_id", "left");
|
||||
$builder->join('ordenes_trabajo t5', 't5.pedido_id = t4.id');
|
||||
$builder->where("t1.tipo_envio", $tipo_envio);
|
||||
|
||||
$builder->groupBy("t1.id");
|
||||
return $builder;
|
||||
}
|
||||
|
||||
public function getDatatableQueryFerroPrototipo(): BaseBuilder
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id, GROUP_CONCAT(DISTINCT t5.id) AS ots,
|
||||
t1.att, t1.direccion, t1.ciudad, t3.nombre as pais, t1.cp, t1.email, t1.telefono, t1.finalizado"
|
||||
);
|
||||
$builder->join("lg_paises t3", "t3.id = t1.pais_id", "left");
|
||||
$builder->join("pedidos t4", "t4.id = t2.pedido_id", "left");
|
||||
$builder->join('ordenes_trabajo t5', 't5.pedido_id = t4.id');
|
||||
$builder->whereIn("t1.tipo_envio", ["estandar"]);
|
||||
|
||||
$builder->groupBy("t1.id");
|
||||
return $builder;
|
||||
|
||||
Reference in New Issue
Block a user