FIX_managerDashboardStaffID
This commit is contained in:
parent
598ecfaedf
commit
e701cf2521
@ -18,6 +18,8 @@ class DashboardController extends ResourceController
|
|||||||
{
|
{
|
||||||
|
|
||||||
$manager_id = $this->request->getGet('manager_id');
|
$manager_id = $this->request->getGet('manager_id');
|
||||||
|
$staff_id = $this->request->getGet('staff_id') ?? '';
|
||||||
|
|
||||||
$today = date('Y-m-d');
|
$today = date('Y-m-d');
|
||||||
$month = date('m');
|
$month = date('m');
|
||||||
$year = date('Y');
|
$year = date('Y');
|
||||||
@ -122,8 +124,7 @@ class DashboardController extends ResourceController
|
|||||||
// ->groupBy('ps.id, ps.name')
|
// ->groupBy('ps.id, ps.name')
|
||||||
// ->get()->getResultArray();
|
// ->get()->getResultArray();
|
||||||
|
|
||||||
|
$builder = $this->db->table('partner_enquiry pe')
|
||||||
$staffLevelPendingSummary = $this->db->table('partner_enquiry pe')
|
|
||||||
->select("
|
->select("
|
||||||
ps.name AS staff_name,
|
ps.name AS staff_name,
|
||||||
ps.id AS staff_id,
|
ps.id AS staff_id,
|
||||||
@ -140,11 +141,17 @@ class DashboardController extends ResourceController
|
|||||||
->where('pe.is_active', 1)
|
->where('pe.is_active', 1)
|
||||||
->where('pe.assigned_to IS NOT NULL')
|
->where('pe.assigned_to IS NOT NULL')
|
||||||
->where('ps.name IS NOT NULL')
|
->where('ps.name IS NOT NULL')
|
||||||
->where('pe.assigned_to !=', 0)
|
->where('pe.assigned_to !=', 0);
|
||||||
->groupBy('pe.assigned_to')
|
|
||||||
->orderBy('ps.name', 'ASC')
|
if (!empty($staff_id)) {
|
||||||
->get()
|
$builder->where('ps.id', $staff_id);
|
||||||
->getResultArray();
|
}
|
||||||
|
|
||||||
|
$staffLevelPendingSummary = $builder
|
||||||
|
->groupBy('pe.assigned_to')
|
||||||
|
->orderBy('ps.name', 'ASC')
|
||||||
|
->get()
|
||||||
|
->getResultArray();
|
||||||
|
|
||||||
foreach ($staffLevelPendingSummary as &$row) {
|
foreach ($staffLevelPendingSummary as &$row) {
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user