diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 22a2c0c0..7bd9590e 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -3878,6 +3878,7 @@ class EmployeeRestController extends AdminController { $emp_id = $this->request->getGet('emp_id'); + $db = \Config\Database::connect(); $data = $db->table('employees e') ->select('pt.policy_type, @@ -3894,11 +3895,12 @@ class EmployeeRestController extends AdminController ->get() ->getResultArray(); - + // print_r($db->getLastQuery());die(); + // print_r($data);die(); // Loop through $data and check for policy_type = GMC $userParams = []; foreach ($data as $row) { - if ($row['policy_type'] === 'GMC') { + // if ($row['policy_type'] === 'GMC') { $userParams['name'] = $row['name']; $userParams['email'] = $row['email']; $userParams['phone'] = $row['phone']; @@ -3917,14 +3919,14 @@ class EmployeeRestController extends AdminController $userParams['moduleName'] = 'home'; break; // stop after first GMC match - } + // } } if (empty($userParams)) { return $this->respond(['status' => 'failed','message' => 'Coming soon........!'], 200); } - + // echo 'coming';die(); // Derive 32-byte key from SHA256 $derivedKey = hash('sha256', env('VISIT_SECRET_KEY'), true); diff --git a/app/Controllers/NotificationController.php b/app/Controllers/NotificationController.php index 6efe58e3..82771ba4 100755 --- a/app/Controllers/NotificationController.php +++ b/app/Controllers/NotificationController.php @@ -201,10 +201,17 @@ class NotificationController extends AdminController } if( isset($value['template_name']) && !empty($value['template_name']) && $value['template_name'] == "member_common_mail"){ - $value['common_mails'] = $this->CommonEMailModel->where('notification_id',$value['id'])->findAll()??[]; + $common_mails = $this->CommonEMailModel + ->where('notification_id',$value['id']) + ->where('is_active',1) + ->findAll()??[]; + $value['comman_mails'] = !empty($common_mails) + ? trim(implode("," , array_column( $common_mails,'email') )) + : []; + } - + return json_encode($value); diff --git a/app/Views/notification.php b/app/Views/notification.php index 99be6c3d..c6d84602 100755 --- a/app/Views/notification.php +++ b/app/Views/notification.php @@ -359,6 +359,7 @@ +