From c471131171da8819be8d64b76efbda645efd404d Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Fri, 3 Jul 2026 17:49:28 +0530 Subject: [PATCH] WELLNESS issue : GWM --- app/Controllers/EmployeeRestController.php | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index feeb8634..cc4767dc 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -3061,12 +3061,23 @@ class EmployeeRestController extends AdminController ->where('client_branch_id', $this->request->getGet('client_branch_id')) ->where('is_active', 1)->findAll(); - $employeeSelfData = $this->employeeModel->where('emp_code', $this->request->getGet('emp_code')) - ->where('client_id', $this->request->getGet('client_id')) - ->where('client_branch_id', $this->request->getGet('client_branch_id')) - ->where('family_floater_key', 'self')->where('is_active', 1) - ->orderBy('id', 'DESC') - ->get()->getRow(); + // get self data corporate email ore mobile no should not be null + $employeeSelfData = $this->employeeModel + ->where('emp_code', $this->request->getGet('emp_code')) + ->where('client_id', $this->request->getGet('client_id')) + ->where('client_branch_id', $this->request->getGet('client_branch_id')) + ->where('family_floater_key', 'self') + ->where('is_active', 1) + ->groupStart() + ->where('email_corporate IS NOT NULL', null, false) + ->orWhere('mobile IS NOT NULL', null, false) + ->groupEnd() + ->orderBy('id', 'DESC') + ->get() + ->getRow(); + + // dd(db_connect()->getLastQuery()->getQuery()); + // dd($employeeSelfData->id); //employee id $employeeName = $employeeSelfData->name ?? "";