GWM : Ticket

This commit is contained in:
Gowtham M 2025-02-25 11:53:01 +05:30
parent fe6a1a22a1
commit 5c3d928c24
2 changed files with 11 additions and 6 deletions

View File

@ -3251,6 +3251,8 @@ class EmployeeRestController extends AdminController
$modeOFIntimate = $this->ticketController->modeOFIntimate; $modeOFIntimate = $this->ticketController->modeOFIntimate;
$claimType = $this->ticketController->claimType; $claimType = $this->ticketController->claimType;
$relationshipType = $this->ticketController->relationshipType; $relationshipType = $this->ticketController->relationshipType;
$ticketTypeArray = $this->ticketController->ticketType;
$emp_id = $this->request->getGet('emp_id'); $emp_id = $this->request->getGet('emp_id');
$ticket_type = $this->request->getGet('ticket_type') ?? null; $ticket_type = $this->request->getGet('ticket_type') ?? null;
@ -3291,6 +3293,8 @@ class EmployeeRestController extends AdminController
$claimPrimaryTypey = "2"; $claimPrimaryTypey = "2";
} }
$ticket_data[$key]['claim_type_value'] = $claimType[$claimPrimaryTypey][$value['claim_type']] ?? null; $ticket_data[$key]['claim_type_value'] = $claimType[$claimPrimaryTypey][$value['claim_type']] ?? null;
$ticket_data[$key]['ticket_policy_type'] = $ticketTypeArray[$value['ticket_type_id']] ?? null;
} }
} }

View File

@ -680,16 +680,17 @@ class TicketMasterModel extends Model
//api //api
public function get_ticket_data($emp_id, $ticket_type = null, $ticket_id = null) public function get_ticket_data($emp_id, $ticket_type = null, $ticket_id = null)
{ {
$query = $this->select('*') $query = $this->select('ticket_master.*, tms.mail_subject as subject')
->where('is_active', 1) ->join('ticket_messages tms', 'ticket_master.id = tms.ticket_id', 'left')
->where('emp_id', $emp_id); ->where('ticket_master.is_active', 1)
->where('ticket_master.emp_id', $emp_id);
if (!empty($ticket_id)) { if (!empty($ticket_id)) {
$query->where('id', $ticket_id); $query->where('ticket_master.id', $ticket_id);
} }
if (!empty($ticket_type)) { if (!empty($ticket_type)) {
$query->where('ticket_type_id', $ticket_type); $query->where('ticket_master.ticket_type_id', $ticket_type);
} }
$data = $query->findAll(); $data = $query->findAll();