FIX_CLAIM_STATUS
This commit is contained in:
parent
7afb037374
commit
ab420c7054
@ -3850,6 +3850,8 @@ class EmployeeRestController extends AdminController
|
||||
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
|
||||
}else if(in_array($value['old_status_id'], $claim_value)){
|
||||
$ticket_data[$key]['claim_status'] = $claim_key ?? null; // Assign back to the main array
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -793,7 +793,26 @@ class TicketMasterModel extends Model
|
||||
//api
|
||||
public function get_ticket_data($emp_id, $returnType,$ticket_type = null, $ticket_id = null)
|
||||
{
|
||||
$query = $this->select('ticket_master.*, tms.mail_subject as subject, tms.id as ticket_message_id')
|
||||
$query = $this->select("
|
||||
|
||||
ticket_master.*,
|
||||
tms.mail_subject as subject,
|
||||
tms.id as ticket_message_id,
|
||||
(
|
||||
SELECT th1.old_value
|
||||
FROM ticket_history th1
|
||||
JOIN ticket_claim_status tcs ON th1.old_value = tcs.id
|
||||
WHERE th1.field_name = 'claim_status_id'
|
||||
AND th1.ticket_id = ticket_master.id
|
||||
AND th1.id = (
|
||||
SELECT MAX(th2.id)
|
||||
FROM ticket_history th2
|
||||
WHERE th2.ticket_id = th1.ticket_id
|
||||
AND th2.field_name = 'claim_status_id'
|
||||
)
|
||||
) AS old_status_id
|
||||
|
||||
")
|
||||
->join('ticket_messages tms', 'ticket_master.id = tms.ticket_id', 'left')
|
||||
->where('ticket_master.is_active', 1);
|
||||
$query->whereIn('sender', ['staff', 'user']);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user