FIX_ISSUE
This commit is contained in:
parent
5c11ce0fa3
commit
7809c16d4a
@ -639,6 +639,8 @@ $routes->group("employeeRest", ["filter" => ["authJWT"]], function ($routes) {
|
||||
$routes->get('get_ticket_type',"EmployeeRestController::get_ticket_type");
|
||||
$routes->get('get_ticket_data',"EmployeeRestController::get_ticket_data");
|
||||
|
||||
// add retail policy
|
||||
$routes->post("addEmpRetailPolicy", "EmployeeRestController::addEmpRetailPolicy");
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -4644,7 +4644,7 @@ class EmployeeRestController extends AdminController
|
||||
$mobile_number = $employeeData->mobile ?? null;
|
||||
|
||||
$emp_retail_policy_data = [];
|
||||
if (!empty($emp_id)) {
|
||||
if ($emp_id != null) {
|
||||
|
||||
$emp_retail_policy_data = $this->employeeRetailPolicy
|
||||
->select("
|
||||
@ -4655,14 +4655,16 @@ class EmployeeRestController extends AdminController
|
||||
DATE_FORMAT(employee_retail_policies.policy_start_date, '%d-%b-%Y') as policy_start_date,
|
||||
DATE_FORMAT(employee_retail_policies.policy_end_date, '%d-%b-%Y') as policy_end_date,
|
||||
policy_type.policy_type,
|
||||
policy_type.long_name as policy_type_name,
|
||||
insurers.name as insurer_name
|
||||
policy_type.long_name as policy_type_long_name,
|
||||
insurers.name as insurer_name,
|
||||
insurers.short_name as insurer_short_name
|
||||
")
|
||||
->join('insurers', 'employee_retail_policies.insurer_id = insurers.id')
|
||||
->join('policy_type', 'employee_retail_policies.policy_type_id = policy_type.id')
|
||||
->where('is_active', 1)
|
||||
->where('employee_retail_policies.is_active', 1)
|
||||
->where('emp_id', $emp_id)
|
||||
->findAll();
|
||||
|
||||
}
|
||||
|
||||
$emp_retail_client_data = [];
|
||||
@ -4670,15 +4672,16 @@ class EmployeeRestController extends AdminController
|
||||
if (!empty($mobile_number)) {
|
||||
$emp_retail_client_data = $this->clientModel
|
||||
->select("
|
||||
$emp_id as emp_id
|
||||
policy_transaction.insurer_id
|
||||
policy_transaction.policy_type_id
|
||||
policy_transaction.policy_no
|
||||
$emp_id as emp_id,
|
||||
policy_transaction.insurer_id,
|
||||
policy_transaction.policy_type_id,
|
||||
policy_transaction.policy_no,
|
||||
DATE_FORMAT(policy_transaction.policy_start_date, '%d-%b-%Y') as policy_start_date,
|
||||
DATE_FORMAT(policy_transaction.policy_end_date, '%d-%b-%Y') as policy_end_date,
|
||||
policy_type.policy_type,
|
||||
policy_type.long_name as policy_type_name,
|
||||
insurers.name as insurer_name
|
||||
policy_type.long_name as policy_type_long_name,
|
||||
insurers.name as insurer_name,
|
||||
insurers.short_name as insurer_short_name
|
||||
")
|
||||
->join('policy_transaction', 'policy_transaction.client_id = clients.id')
|
||||
->join('insurers', 'policy_transaction.insurer_id = insurers.id')
|
||||
@ -4689,6 +4692,8 @@ class EmployeeRestController extends AdminController
|
||||
->findAll();
|
||||
}
|
||||
|
||||
// print_r($emp_retail_policy_data); die;
|
||||
|
||||
$complete_emp_retail_policy_data = array_values(
|
||||
array_column(
|
||||
array_merge($emp_retail_policy_data ?: [], $emp_retail_client_data ?: []),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user