FIX_ISSUE
This commit is contained in:
parent
c60ba57a3d
commit
1b043721f9
@ -3732,6 +3732,7 @@ class EmployeeRestController extends AdminController
|
||||
];
|
||||
|
||||
foreach ($ticket_data as $key => $value) {
|
||||
|
||||
foreach ($client_claim_status as $claim_key => $claim_value) {
|
||||
if (in_array($value['claim_status_id'], $claim_value)) { // Corrected argument order
|
||||
$ticket_data[$key]['claim_status'] = $claim_key ?? null; // Assign back to the main array
|
||||
@ -3748,30 +3749,35 @@ class EmployeeRestController extends AdminController
|
||||
$ticket_data[$key]['ticket_policy_type'] = $ticketTypeArray[$value['ticket_type_id']] ?? null;
|
||||
|
||||
$ticketMesssageModel = new TicketMessageModel();
|
||||
$ticket_message_id = $ticketMesssageModel
|
||||
->where('is_active', 1)
|
||||
->where('sender', "user")
|
||||
->where('ticket_id', $ticket_id)
|
||||
->orderBy('id', "desc")
|
||||
->first();
|
||||
$ticket_message = $ticketMesssageModel
|
||||
->where('is_active', 1)
|
||||
->where('sender', "user")
|
||||
->where('ticket_id', $ticket_id)
|
||||
->orderBy('id', "desc")
|
||||
->first();
|
||||
|
||||
$claimFiles = new ClaimFilesModel();
|
||||
$claim_files_data = $claimFiles
|
||||
->select('id as claim_file_id, doc_name as claim_file_name')
|
||||
->where('is_active', 1)
|
||||
->where('file_type', 2)
|
||||
->where('ticket_id', $ticket_id)
|
||||
->where('ticket_message_id', $ticket_message_id['id'])
|
||||
->findAll();
|
||||
$claim_file_urls = [];
|
||||
|
||||
$claim_file_urls = [];
|
||||
foreach ($claim_files_data as $key => &$value) {
|
||||
$value['url'] = base_url('downloadClaimFile/') . $value['id'];
|
||||
$claim_file_urls[] = $value;
|
||||
if ($ticket_message && isset($ticket_message['id'])) {
|
||||
$claimFiles = new ClaimFilesModel();
|
||||
$claim_files_data = $claimFiles
|
||||
->select('id as claim_file_id, doc_name as claim_file_name')
|
||||
->where('is_active', 1)
|
||||
->where('file_type', 2)
|
||||
->where('ticket_id', $ticket_id)
|
||||
->where('ticket_message_id', $ticket_message['id'])
|
||||
->findAll();
|
||||
|
||||
foreach ($claim_files_data as &$value) {
|
||||
$value['url'] = base_url('downloadClaimFile/') . $value['claim_file_id'];
|
||||
$claim_file_urls[] = $value;
|
||||
}
|
||||
unset($value);
|
||||
}
|
||||
unset($value);
|
||||
|
||||
$ticket_data[$key]['claim_files'] = $claim_file_urls;
|
||||
// always set the key (empty if no files found)
|
||||
$ticket_data['claim_files'] = $claim_file_urls;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user