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 ?? "";