fixes little bug where status timestamp was converted from null to the current date, with create_date in php

This commit is contained in:
SimonGschnell
2024-01-23 11:40:02 +01:00
parent df74bade9b
commit 13f2bb4e85
3 changed files with 7 additions and 7 deletions
+1 -2
View File
@@ -72,8 +72,7 @@ class Profil extends Auth_Controller
$_GET = json_decode($this->input->raw_input_stream, true);
$uid = $this->input->get('uid');
$id = $this->input->get('id');
echo $uid;
echo $id;
if($uid && $id){
$res= $this->ProfilChangeModel->getProfilUpdate($uid, $id);
@@ -46,10 +46,11 @@ class Profil_change_model extends DB_Model
// catch error
}else{
if(hasData($res)){
foreach($res->retval as $update){
$update->requested_change = json_decode($update->requested_change);
$update->change_timestamp = date_create($update->change_timestamp)->format('d.m.Y');
$update->status_timestamp = date_create($update->status_timestamp)->format('d.m.Y');
$update->change_timestamp = !is_null($update->change_timestamp)?date_create($update->change_timestamp)->format('d.m.Y'):null;
$update->status_timestamp = !is_null($update->status_timestamp)?date_create($update->status_timestamp)->format('d.m.Y'):null;
}
}
}