tabla interior plana generada

This commit is contained in:
Jaime Jimenez
2023-09-26 21:44:21 +02:00
parent 693504f9d7
commit accb06ba5f
8 changed files with 93 additions and 29 deletions

View File

@ -104,8 +104,9 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.nombre AS papel_generico"
"t1.id as id, t1.nombre AS nombre"
)
->distinct('t1.id')
->join("lg_papel_impresion t2", "t2.papel_generico_id = t1.id", "left")
->join("lg_maquina_papel_impresion t3", "t3.papel_impresion_id = t2.id", "left")
->join("lg_maquinas t4", "t3.maquina_id = t4.id", "left")
@ -126,7 +127,7 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
}
}
return array_unique(array_column($builder->orderBy("t1.nombre", "asc")->get()->getResultArray(), 'papel_generico'));
return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
}
public function getGramajeComparador(string $papel_generico_nombre="")