Dashboard changes : GWM

This commit is contained in:
Gowtham M 2025-12-02 10:49:00 +05:30
parent 535e2c2ba0
commit 5b62b2647f

View File

@ -128,10 +128,8 @@ class DashboardController extends ResourceController
ps.id AS staff_id,
ps.handler_id,
COUNT(pe.id) AS total_assigned,
SUM(CASE WHEN pe.status = 'Awaiting Proposal' THEN 1 ELSE 0 END) AS awaiting_quotation,
SUM(CASE WHEN pe.status = 'Proposal Created' THEN 1 ELSE 0 END) AS pending_quotation_approval,
SUM(CASE WHEN pe.status = 'Proposal Accepted' THEN 1 ELSE 0 END) AS awaiting_policy,
SUM(CASE WHEN pe.status = 'Policy Created' THEN 1 ELSE 0 END) AS policy_created
SUM(CASE WHEN pe.enquiry_status = 'In progress' THEN 1 ELSE 0 END) AS total_in_progress,
SUM(CASE WHEN pe.enquiry_status = 'Completed' THEN 1 ELSE 0 END) AS total_completed
")
->join('partner_staff ps', 'ps.id = pe.assigned_to', 'left')
->where('pe.manager_id', $manager_id)
@ -204,10 +202,8 @@ class DashboardController extends ResourceController
ps.name AS staff_name,
ps.id AS staff_id,
COUNT(pe.id) AS total_assigned,
SUM(CASE WHEN pe.status = 'Awaiting Proposal' THEN 1 ELSE 0 END) AS awaiting_quotation,
SUM(CASE WHEN pe.status = 'Proposal Created' THEN 1 ELSE 0 END) AS pending_quotation_approval,
SUM(CASE WHEN pe.status = 'Proposal Accepted' THEN 1 ELSE 0 END) AS awaiting_policy,
SUM(CASE WHEN pe.status = 'Policy Created' THEN 1 ELSE 0 END) AS policy_created
SUM(CASE WHEN pe.enquiry_status = 'In progress' THEN 1 ELSE 0 END) AS total_in_progress,
SUM(CASE WHEN pe.enquiry_status = 'Completed' THEN 1 ELSE 0 END) AS total_completed
")
->join('partner_staff ps', 'ps.id = pe.assigned_to', 'left')
->where("JSON_CONTAINS(ps.handler_id, '\"$handler_id\"')")