Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev

This commit is contained in:
VENKATESHWARAN 2025-09-09 11:22:34 +05:30
commit 8a6ae61355
7 changed files with 67 additions and 6 deletions

View File

@ -184,6 +184,7 @@ $routes->group("/employee", ["filter" => "authMVC"], function ($routes) {
$routes->post("test-rack-rate", "EmployeeController::testRackRate");
$routes->get('test_members_list', 'EmployeeController::test_members_list');
$routes->post('get_emp_history','EmployeeController::getEmpHistory');
$routes->get("retail-endorsement-list", "EmployeeController::retailendorsementList");
});

View File

@ -3007,4 +3007,11 @@ class EmployeeController extends AdminController
}
public function retailendorsementList()
{
$data['message'] = 'File Not Found';
echo view('errors/404', $data);
}
}

View File

@ -3703,6 +3703,9 @@ class EmployeeRestController extends AdminController
$emp_id = $this->request->getGet('emp_id');
$ticket_type = $this->request->getGet('ticket_type') ?? null;
$ticket_id = $this->request->getGet('ticket_id') ?? null;
$request = \Config\Services::request();
$uri = $request->uri->getPath();
$returnType = (strpos($uri, 'api') !== false) ? 'api' : 'web';
// dd($emp_id);
if (empty($emp_id)) {
@ -3710,7 +3713,7 @@ class EmployeeRestController extends AdminController
}
$TicketMasterModel = new TicketMasterModel();
$ticket_data = $TicketMasterModel->get_ticket_data($emp_id, $ticket_type, $ticket_id);
$ticket_data = $TicketMasterModel->get_ticket_data($emp_id, $returnType, $ticket_type, $ticket_id);
if (!empty($ticket_data)) {

View File

@ -0,0 +1,40 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class PartnerEndorsementRequestModel extends Model
{
protected $table = 'partner_endorsement_request';
protected $primaryKey = 'id';
// Auto-increment
protected $useAutoIncrement = true;
// Return type
protected $returnType = 'array';
// Soft deletes (youre using is_active instead of deleted_at, so keep it false)
protected $useSoftDeletes = false;
// Allowed fields (columns you want to insert/update)
protected $allowedFields = [
'id',
'client_id',
'client_policy_id',
'insurer_id',
'insurer_branch_id',
'policy_number',
'endorsement_no',
'endorsement_type',
'endorsement_description',
'updated_by',
'is_active',
'created_by',
'manager_id',
'agent_id',
'status',
];
}

View File

@ -791,13 +791,19 @@ class TicketMasterModel extends Model
}
//api
public function get_ticket_data($emp_id, $ticket_type = null, $ticket_id = null)
public function get_ticket_data($emp_id, $returnType,$ticket_type = null, $ticket_id = null)
{
$query = $this->select('ticket_master.*, tms.mail_subject as subject')
->join('ticket_messages tms', 'ticket_master.id = tms.ticket_id', 'left')
->where('ticket_master.is_active', 1)
->where('tms.sender', "user")
->where('ticket_master.emp_id', $emp_id);
->where('ticket_master.is_active', 1);
if($returnType == 'api'){
$query->whereIn('sender', ['staff', 'user']);
}else{
$query->where('tms.sender', "user");
}
$query->where('ticket_master.emp_id', $emp_id);
if (!empty($ticket_id)) {
$query->where('ticket_master.id', $ticket_id);
@ -808,7 +814,8 @@ class TicketMasterModel extends Model
}
$data = $query->findAll();
// dd($data, db_connect()->getLastQuery());
// dd($data, db_connect()->getLastQuery());
// print_r($this->db->getLastQuery());die;
return $data;
}

View File

@ -1332,6 +1332,9 @@ a.app-badge-secondary:focus, a.app-badge-secondary.focus {
<li>
<a href="<?= base_url('/employee/test_members_list') ?>">Test Members List</a>
</li>
<li>
<a href="<?= base_url('/employee/retail-endorsement-list') ?>">Retail Endorsement</a>
</li>
</ul>
</div>
</li>

View File