mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'fix/user_id_presupuestos' into 'main'
Añadidos IDs de los usuarios creador y actualizador al guardar desde presupuesto cliente See merge request jjimenez/safekat!787
This commit is contained in:
@ -508,15 +508,17 @@ class PresupuestoModel extends \App\Models\BaseModel
|
|||||||
'excluir_rotativa' => $excluir_rotativa,
|
'excluir_rotativa' => $excluir_rotativa,
|
||||||
|
|
||||||
];
|
];
|
||||||
|
/* Actualizacion */
|
||||||
if ($id != 0) {
|
if ($id != 0) {
|
||||||
$fields['id'] = $id;
|
$fields['id'] = $id;
|
||||||
$fields['updated_at'] = date('Y-m-d H:i:s', now());
|
$fields['updated_at'] = date('Y-m-d H:i:s', now());
|
||||||
}
|
$fields['user_update_id'] = auth()->id();
|
||||||
|
|
||||||
if ($id != 0) {
|
|
||||||
$this->db->table($this->table)->where('id', $id)->update($fields);
|
$this->db->table($this->table)->where('id', $id)->update($fields);
|
||||||
return $id;
|
return $id;
|
||||||
} else {
|
}
|
||||||
|
/* Inserccion */
|
||||||
|
else {
|
||||||
|
$fields['user_created_id'] = auth()->id();
|
||||||
$this->db->table($this->table)->insert($fields);
|
$this->db->table($this->table)->insert($fields);
|
||||||
return $this->db->insertID();
|
return $this->db->insertID();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user