GWM : handler_id in staff table changesed from int to json
This commit is contained in:
parent
286af4ccc0
commit
a923f575fc
@ -27,7 +27,7 @@ $routes->group('api', ['filter' => 'appSignature'], function ($routes) {
|
||||
|
||||
|
||||
//api's with token
|
||||
$routes->group('api', ['filter' => ["jwtAuth","appSignature"] ], function ($routes) {
|
||||
// $routes->group('api', ['filter' => ["jwtAuth","appSignature"] ], function ($routes) {
|
||||
|
||||
//logout
|
||||
$routes->get('auth/logout', 'StaffAuthController::logout');
|
||||
@ -109,7 +109,7 @@ $routes->group('api', ['filter' => 'appSignature'], function ($routes) {
|
||||
$routes->get('dashboard/staffDashboard', 'DashboardController::staffDashboard');
|
||||
$routes->get('dashboard/agentDashboard', 'DashboardController::agentDashboard');
|
||||
|
||||
});
|
||||
// });
|
||||
|
||||
|
||||
|
||||
|
||||
@ -134,7 +134,8 @@ class DashboardController extends ResourceController
|
||||
SUM(CASE WHEN pe.status = 'Policy Created' THEN 1 ELSE 0 END) AS policy_created
|
||||
")
|
||||
->join('partner_staff ps', 'ps.id = pe.assigned_to', 'left')
|
||||
->join('partner_staff ph', 'ph.id = ps.handler_id', 'left')
|
||||
->join('partner_staff ph', 'JSON_CONTAINS(ps.handler_id, CAST(ph.id AS JSON))', 'left')
|
||||
// ->join('partner_staff ph', 'ph.id = ps.handler_id', 'left')
|
||||
->where('pe.manager_id', $manager_id)
|
||||
->where('pe.is_active', 1)
|
||||
->groupBy('pe.assigned_to')
|
||||
@ -193,7 +194,8 @@ class DashboardController extends ResourceController
|
||||
SUM(CASE WHEN pe.status = 'Policy Created' THEN 1 ELSE 0 END) AS policy_created
|
||||
")
|
||||
->join('partner_staff ps', 'ps.id = pe.assigned_to', 'left')
|
||||
->where('ps.handler_id', $handler_id)
|
||||
->where("JSON_CONTAINS(ps.handler_id, '\"$handler_id\"')")
|
||||
// ->where('ps.handler_id', $handler_id)
|
||||
->where('pe.is_active', 1)
|
||||
->groupBy('pe.assigned_to')
|
||||
->orderBy('ps.name', 'ASC')
|
||||
|
||||
@ -36,10 +36,11 @@ class StaffController extends ResourceController
|
||||
|
||||
$data = $this->StaffModel->select('partner_staff.* , R.role')
|
||||
->join('partner_role_master R', 'R.id = partner_staff.role_id', 'left')
|
||||
->where('partner_staff.handler_id' , $handler_id )
|
||||
->where("JSON_CONTAINS(partner_staff.handler_id, '\"$handler_id\"')")
|
||||
// ->where('partner_staff.handler_id' , $handler_id )
|
||||
->findAll();
|
||||
}
|
||||
|
||||
dd($data);
|
||||
|
||||
|
||||
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $data], 200);
|
||||
@ -57,7 +58,8 @@ class StaffController extends ResourceController
|
||||
|
||||
$data = $this->StaffModel->select('partner_staff.id, partner_staff.name , R.role')
|
||||
->join('partner_role_master R', 'R.id = partner_staff.role_id', 'left')
|
||||
->where('partner_staff.handler_id' , $handler_id )
|
||||
->where("JSON_CONTAINS(partner_staff.handler_id, '\"$handler_id\"')")
|
||||
// ->where('partner_staff.handler_id' , $handler_id )
|
||||
->where('partner_staff.role_id' , 3 )
|
||||
->where('partner_staff.is_active' , 1 )
|
||||
->findAll();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user