From 8b340b76d3b99914c07c987af4748bf8ff1c4b82 Mon Sep 17 00:00:00 2001 From: Ignacio Martinez Navajas Date: Tue, 6 May 2025 10:17:33 +0200 Subject: [PATCH] =?UTF-8?q?A=C3=B1adidos=20IDs=20de=20los=20usuarios=20cre?= =?UTF-8?q?ador=20y=20actualizador=20al=20guardar=20desde=20presupuesto=20?= =?UTF-8?q?cliente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ci4/app/Models/Presupuestos/PresupuestoModel.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ci4/app/Models/Presupuestos/PresupuestoModel.php b/ci4/app/Models/Presupuestos/PresupuestoModel.php index c57aa1c0..04699831 100755 --- a/ci4/app/Models/Presupuestos/PresupuestoModel.php +++ b/ci4/app/Models/Presupuestos/PresupuestoModel.php @@ -508,15 +508,17 @@ class PresupuestoModel extends \App\Models\BaseModel 'excluir_rotativa' => $excluir_rotativa, ]; + /* Actualizacion */ if ($id != 0) { $fields['id'] = $id; $fields['updated_at'] = date('Y-m-d H:i:s', now()); - } - - if ($id != 0) { + $fields['user_update_id'] = auth()->id(); $this->db->table($this->table)->where('id', $id)->update($fields); return $id; - } else { + } + /* Inserccion */ + else { + $fields['user_created_id'] = auth()->id(); $this->db->table($this->table)->insert($fields); return $this->db->insertID(); }