mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 00:24:35 +00:00
adds breadcrumb to modal and adjusts controller functions and api calls
This commit is contained in:
@@ -15,7 +15,8 @@ class Profil_change_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
* getLastStatuses
|
||||
* getTimestamp
|
||||
* returns insert or update timestamp of a certain profil update
|
||||
*/
|
||||
public function getTimestamp($uid){
|
||||
$this->addSelect(['change_timestamp']);
|
||||
@@ -23,4 +24,31 @@ class Profil_change_model extends DB_Model
|
||||
return hasData($res) ? getData($res)[0]->change_timestamp : null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* getProfilUpdate
|
||||
* returns a profil update with id
|
||||
* returns all profil updates if id is set to null
|
||||
*/
|
||||
public function getProfilUpdate($uid,$id=null){
|
||||
$whereClause = ["uid"=>$uid];
|
||||
if(!is_null($id)){
|
||||
$whereClause['profil_update_id']=$id;
|
||||
}
|
||||
|
||||
$res = $this->loadWhere($whereClause);
|
||||
if(isError($res)){
|
||||
// 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');
|
||||
}
|
||||
}
|
||||
}
|
||||
return $res;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user