Compare commits
1 Commits
9609e56727
...
5e356ca1ee
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e356ca1ee |
@ -48,7 +48,10 @@ class SidebarCertificateCell extends Cell {
|
||||
SUM(CASE WHEN certificates.cert_type = 'IC' THEN 1 ELSE 0 END) as totalIc
|
||||
")
|
||||
->join('users', 'users.userid = certificates.user_id', 'left')
|
||||
->where('users.reportto', $userId)
|
||||
->groupStart() // Mulai kurung buka (
|
||||
->where('users.reportto', $userId)
|
||||
->orWhere('certificates.user_id', $userId)
|
||||
->groupEnd() // Tutup kurung )
|
||||
->where('certificates.status', 'unvalidated')
|
||||
->Where('certificates.spv_validation_at', null)
|
||||
->where('certificates.deleted_at', null)
|
||||
|
||||
@ -49,6 +49,7 @@ class Certificates extends BaseController {
|
||||
if (in_array($userPosId, [1, 3, 5])) { // Manager & IT: Tidak perlu filter tambahan (lihat semua)
|
||||
} else if ($userPosId == 2) { // SPV: Melihat data user yang "reportto"-nya adalah ID supervisor ini
|
||||
$builder->where('users.reportto', $userId);
|
||||
$builder->Orwhere('certificates.user_id', $userId);
|
||||
} else if ($userPosId == 4) { // TSOIVD: Hanya melihat data milik sendiri
|
||||
$builder->where('certificates.user_id', $userId);
|
||||
} else {// Role lain: Tidak diberi akses
|
||||
@ -214,6 +215,7 @@ class Certificates extends BaseController {
|
||||
if (in_array($userPosId, [1, 3, 5])) { // Manager & IT: Tidak perlu filter tambahan (lihat semua)
|
||||
} else if ($userPosId == 2) { // SPV: Melihat data user yang "reportto"-nya adalah ID supervisor ini
|
||||
$builder->where('users.reportto', $userId);
|
||||
$builder->Orwhere('certificates.user_id', $userId);
|
||||
} else if ($userPosId == 4) { // TSOIVD: Hanya melihat data milik sendiri
|
||||
$builder->where('certificates.user_id', $userId);
|
||||
} else {// Role lain: Tidak diberi akses
|
||||
@ -383,6 +385,7 @@ class Certificates extends BaseController {
|
||||
if (in_array($userPosId, [1, 3, 5])) { // Manager & IT: Tidak perlu filter tambahan (lihat semua)
|
||||
} else if ($userPosId == 2) { // SPV: Melihat data user yang "reportto"-nya adalah ID supervisor ini
|
||||
$builder->where('users.reportto', $userId);
|
||||
$builder->Orwhere('certificates.user_id', $userId);
|
||||
} else if ($userPosId == 4) { // TSOIVD: Hanya melihat data milik sendiri
|
||||
$builder->where('certificates.user_id', $userId);
|
||||
} else {// Role lain: Tidak diberi akses
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user