faltan las direcciones

This commit is contained in:
2025-03-18 15:58:03 +01:00
parent 5e542dc862
commit daafdf2d5a
4 changed files with 82 additions and 5 deletions

View File

@ -72,6 +72,9 @@ class ImportadorModel extends \App\Models\BaseModel
if($query > 0){
$datosGenerales->prototipo = 1;
}
else{
$datosGenerales->prototipo = 0;
}
$builder = $db->table('pedido_libro_linea t1')
->select('t1.tipo as tipo, t1.hq as hq, t1.paginas as paginas, t1.papel_id as papel_id,
@ -92,6 +95,34 @@ class ImportadorModel extends \App\Models\BaseModel
}
public function getDatosGuardar($id){
$db = \Config\Database::connect($this->DBGroup); // Conectar a olderp
$db = \Config\Database::connect($this->DBGroup); // Conectar a olderp
$builder = $db->table('pedido_libro t1')
->select('
t1.titulo, t1.autor, t1.coleccion, t1.isbn, t1.customer_reference as referencia_cliente,
t1.envios_recogecliente as entrega_taller')
->join('papel_formato t2', 't1.papel_formato_id = t2.id', 'left')
->where('t1.id', $id)
->where('t1.deleted_at', NULL);
$query = $builder->get();
$datosGenerales = $query->getRow();
return $query->getRow();
}
public function getDirecciones($id){
$db = \Config\Database::connect($this->DBGroup); // Conectar a olderp
$builder = $db->table('pedido_libro_envios t1')
->select('t1.ejemplares as unidades, t1.att, t1.email, t1.direccion, t1.pais,
t2.nombre as provincia, t1.ciudad as municipio, t1.cp, t1.telefono')
->join(('provincias t2'), 't1.provincia = t2.code', 'left')
->where('t1.pedido_libro_id', $id);
$query = $builder->get();
return $query->getResultObject();
}
}