diff --git a/app/Controllers/LeadsController.php b/app/Controllers/LeadsController.php index 2c506aed..dfd99a43 100644 --- a/app/Controllers/LeadsController.php +++ b/app/Controllers/LeadsController.php @@ -825,6 +825,7 @@ class LeadsController extends BaseController $last_3_years_claims = $data['finyear']; $processedData[] = [ + 'actual_lead_id' => $data['actual_lead_id'] ?? null, 'lead_type' => $data['lead_type'], 'issuer' => $data['issuer'], 'client_type' => $data['client_type'], diff --git a/app/Controllers/SalesController.php b/app/Controllers/SalesController.php index a830542e..c3f870c5 100644 --- a/app/Controllers/SalesController.php +++ b/app/Controllers/SalesController.php @@ -863,9 +863,10 @@ class SalesController extends BaseController // 5. Team Performance $teamPerformance = $db->table('user_profiles as u') - ->select('u.first_name, u.last_name, u.profile as role, + ->select('u.first_name, u.last_name, r.role, (SELECT COUNT(*) FROM sales_activities WHERE assigned_to = u.id) as total_acts, (SELECT COUNT(*) FROM sales_activities WHERE assigned_to = u.id AND status = "completed") as done_acts') + ->join('roles r', 'r.id = u.role') ->where('u.nhance_branch_id', $branchId) ->whereIn('u.id', $sales_manager_ids) ->where('u.is_active', 1) diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index f5109843..b7271a2c 100755 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -2077,7 +2077,7 @@ - +