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(); }