diff --git a/app/Controllers/ThzController.php b/app/Controllers/ThzController.php index 059ebfce..1c0f9535 100644 --- a/app/Controllers/ThzController.php +++ b/app/Controllers/ThzController.php @@ -196,19 +196,28 @@ class ThzController extends BaseController if ($returnType === 'api') { return $this->response->setJSON((['status' => 'success', 'data' => $result]))->setStatusCode(200); }else{ - $toGetCreatedBy = $result['master'][0]['created_by']; + + $assign_to = $result['master'][0]['assign_to']; + $mobile = $result['master'][0]['mobile']; + $toGetPolicyId = (!empty($result['master'][0]['policy_id']) && strtolower($result['master'][0]['policy_id']) !== 'null') ? $result['master'][0]['policy_id'] : ''; $result['related_tickets'] = $this->thzMasterModel - ->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name') - ->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left') - ->where('thz_master.created_by', $toGetCreatedBy) - ->findAll(); + ->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name') + ->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left') + ->where('thz_master.assign_to', $assign_to) + ->where('thz_master.mobile',$mobile) + ->where('thz_master.thz_id !=',$thz_id) + ->where('thz_master.status !=','Closed') + ->where('thz_master.status !=','Resolved') + ->findAll(); + $result['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['2', '3','4'])->findAll(); // enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu // 2,3,4 remain person varannum. - $result['policy_terms'] = $toGetPolicyId ? $this->getPolicyTerms($toGetPolicyId) : ''; + $result['policy_terms'] = $toGetPolicyId ? $this->getPolicyTerms($toGetPolicyId) : ''; + return $this->loadLayout('thz_notes', $result); } diff --git a/app/Views/thz_notes.php b/app/Views/thz_notes.php index 6bffa681..52dfb006 100644 --- a/app/Views/thz_notes.php +++ b/app/Views/thz_notes.php @@ -327,9 +327,17 @@