FIX_CLAIMAPI_FOR_HR
This commit is contained in:
parent
e469a820da
commit
8c4fcfbf50
@ -2595,6 +2595,25 @@ class EmployeeRestController extends AdminController
|
|||||||
$data['claims_data'] = $this->ticketMaster->getTicketDataByTicketID($ticket_id);
|
$data['claims_data'] = $this->ticketMaster->getTicketDataByTicketID($ticket_id);
|
||||||
$data['ticket_data'] = $ticketController->getMoreInfo($requestFrom = 'rest', $ticket_id);
|
$data['ticket_data'] = $ticketController->getMoreInfo($requestFrom = 'rest', $ticket_id);
|
||||||
|
|
||||||
|
|
||||||
|
// $data = $response['data']; // Assuming your full array is stored in $response
|
||||||
|
// $ticketData = $data['ticket_data'];
|
||||||
|
// $ticketHistory = $data['ticket_history'];
|
||||||
|
|
||||||
|
// Loop through ticket_data
|
||||||
|
foreach ($data['ticket_data'] as $status => &$fields) {
|
||||||
|
// Search ticket_history for matching old_status_value
|
||||||
|
foreach ($data['ticket_history'] as $history) {
|
||||||
|
if ($history['old_status_value'] === $status) {
|
||||||
|
// Attach modified_by and created_at
|
||||||
|
$fields['modified_by'] = $history['modified_by'];
|
||||||
|
$fields['modified_at'] = date('d-m-Y h:i A', strtotime($history['created_at']));
|
||||||
|
// Break after first match (assuming latest entry is enough)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return $this->respond(['status' => (count($data) ? 'success' : 'failed'),'code' => (count($data) ? 200 : 404),'data' => $data ], 200);
|
return $this->respond(['status' => (count($data) ? 'success' : 'failed'),'code' => (count($data) ? 200 : 404),'data' => $data ], 200);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user