mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 08:52:21 +00:00
- Added new model CL/Messages_model.php
- Moved logic from controllers system/Messages and ViewMessage to CL/Messages_model - Better code - MessageLib and PersonLogLib methods do not use anymore show_error and return success/error object - helpers/hlp_message_helper: hasData function changed
This commit is contained in:
@@ -42,11 +42,7 @@ class PersonLogLib
|
||||
'insertvon' => $user
|
||||
);
|
||||
|
||||
$result = $this->ci->PersonLogModel->insert($data);
|
||||
if (isSuccess($result))
|
||||
return true;
|
||||
else
|
||||
show_error($result->retval);
|
||||
return $this->ci->PersonLogModel->insert($data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,10 +116,9 @@ class PersonLogLib
|
||||
*/
|
||||
public function unPark($person_id)
|
||||
{
|
||||
$result = $this->ci->PersonLogModel->getLogsInFuture($person_id);
|
||||
|
||||
$deleted = array();
|
||||
|
||||
$result = $this->ci->PersonLogModel->getLogsInFuture($person_id);
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach ($result->retval as $log)
|
||||
@@ -133,12 +128,22 @@ class PersonLogLib
|
||||
{
|
||||
$delresult = $this->ci->PersonLogModel->deleteLog($log->log_id);
|
||||
if (isSuccess($delresult))
|
||||
{
|
||||
$deleted[] = $log->log_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $delresult;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
|
||||
return $deleted;
|
||||
return success($deleted);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user