mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into feat/maquinas-corte-ot
This commit is contained in:
@ -924,6 +924,29 @@ class ProductionService extends BaseService
|
||||
|
||||
|
||||
|
||||
return $q;
|
||||
}
|
||||
public function maquinaPlanaDatatableQuery()
|
||||
{
|
||||
$q = $this->otModel->builder()->select([
|
||||
"lg_maquinas.nombre as maquinaNombre",
|
||||
"lg_maquinas.id as maquinaId",
|
||||
"COUNT(orden_trabajo_tareas.id) as tareasCount",
|
||||
"presupuesto_linea.pliegos_pedido as pliegosPedido",
|
||||
"SUM(ordenes_trabajo.total_tirada) as totalTirada",
|
||||
"SUM(orden_trabajo_tareas.tiempo_real) as tiempoReal"
|
||||
])
|
||||
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||
->join("presupuestos", "presupuestos.id = presupuesto_linea.presupuesto_id", "right")
|
||||
->join('lg_maquinas',"lg_maquinas.id = orden_trabajo_tareas.maquina_id","left")
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->where("orden_trabajo_tareas.presupuesto_linea_id IS NOT NULL", NULL, FALSE)
|
||||
->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA)
|
||||
->groupBy('lg_maquinas.id');
|
||||
|
||||
|
||||
|
||||
return $q;
|
||||
}
|
||||
/**
|
||||
@ -1334,13 +1357,14 @@ class ProductionService extends BaseService
|
||||
->whereIn("presupuesto_linea.tipo", $this->TIPOS_ROTATIVA)
|
||||
->where('lg_maquinas.is_rotativa', true)
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
||||
->orderBy("orden_trabajo_tareas.orden", "ASC")
|
||||
->groupBy('lg_maquinas.id');
|
||||
if ($q) {
|
||||
$query->like('lg_maquinas.nombre', $q);
|
||||
}
|
||||
return $query->get()->getResultArray();
|
||||
}
|
||||
public function querySelectMaquinaPlanningPlana($q)
|
||||
public function querySelectMaquinaPlanningPlana($q,?string $padreId)
|
||||
{
|
||||
$query = $this->otModel->builder()->select([
|
||||
"orden_trabajo_tareas.maquina_id as id",
|
||||
@ -1352,10 +1376,14 @@ class ProductionService extends BaseService
|
||||
->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA)
|
||||
->where('lg_maquinas.is_rotativa', false)
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
||||
->orderBy("orden_trabajo_tareas.orden", "ASC")
|
||||
->groupBy('lg_maquinas.id');
|
||||
if ($q) {
|
||||
$query->like('lg_maquinas.nombre', $q);
|
||||
}
|
||||
if($padreId){
|
||||
$query->where('lg_maquinas.padre_id',$padreId);
|
||||
}
|
||||
return $query->get()->getResultArray();
|
||||
}
|
||||
public function querySelectMaquinaPadrePlanningPlana($q)
|
||||
|
||||
Reference in New Issue
Block a user