fix sort order sidebar menu and percentage bigdata resume
This commit is contained in:
@@ -76,19 +76,19 @@ class BigDataResumeController extends Controller
|
|||||||
$total_potensi_percentage = $big_data_resume->potention_sum > 0 && $target_pad > 0
|
$total_potensi_percentage = $big_data_resume->potention_sum > 0 && $target_pad > 0
|
||||||
? round(($big_data_resume->potention_sum / $target_pad) * 100, 2) : 0;
|
? round(($big_data_resume->potention_sum / $target_pad) * 100, 2) : 0;
|
||||||
|
|
||||||
// percentage verified document (verified_sum / potention_sum) - by value/amount
|
// // percentage verified document (verified_sum / potention_sum) - by value/amount
|
||||||
$verified_percentage = $big_data_resume->potention_sum > 0 && $big_data_resume->verified_sum >= 0
|
// $verified_percentage = $big_data_resume->potention_sum > 0 && $big_data_resume->verified_sum >= 0
|
||||||
? round(($big_data_resume->verified_sum / $big_data_resume->potention_sum) * 100, 2) : 0;
|
// ? round(($big_data_resume->verified_sum / $big_data_resume->potention_sum) * 100, 2) : 0;
|
||||||
|
|
||||||
// percentage non-verified document (non_verified_sum / potention_sum) - by value/amount
|
// // percentage non-verified document (non_verified_sum / potention_sum) - by value/amount
|
||||||
$non_verified_percentage = $big_data_resume->potention_sum > 0 && $big_data_resume->non_verified_sum >= 0
|
// $non_verified_percentage = $big_data_resume->potention_sum > 0 && $big_data_resume->non_verified_sum >= 0
|
||||||
? round(($big_data_resume->non_verified_sum / $big_data_resume->potention_sum) * 100, 2) : 0;
|
// ? round(($big_data_resume->non_verified_sum / $big_data_resume->potention_sum) * 100, 2) : 0;
|
||||||
|
|
||||||
// Alternative: percentage by count (if needed)
|
// Alternative: percentage by count (if needed)
|
||||||
// $verified_count_percentage = $big_data_resume->potention_count > 0
|
$verified_count_percentage = $big_data_resume->potention_count > 0 && $big_data_resume->verified_count > 0
|
||||||
// ? round(($big_data_resume->verified_count / $big_data_resume->potention_count) * 100, 2) : 0;
|
? round(($big_data_resume->verified_count / $big_data_resume->potention_count) * 100, 2) : 0;
|
||||||
// $non_verified_count_percentage = $big_data_resume->potention_count > 0
|
$non_verified_count_percentage = $big_data_resume->potention_count > 0 && $big_data_resume->non_verified_count > 0
|
||||||
// ? round(($big_data_resume->non_verified_count / $big_data_resume->potention_count) * 100, 2) : 0;
|
? round(($big_data_resume->non_verified_count / $big_data_resume->potention_count) * 100, 2) : 0;
|
||||||
|
|
||||||
// percentage business document (business / non_verified)
|
// percentage business document (business / non_verified)
|
||||||
$business_percentage = $big_data_resume->non_verified_sum > 0 && $big_data_resume->business_sum >= 0
|
$business_percentage = $big_data_resume->non_verified_sum > 0 && $big_data_resume->business_sum >= 0
|
||||||
@@ -146,12 +146,12 @@ class BigDataResumeController extends Controller
|
|||||||
'verified_document' => [
|
'verified_document' => [
|
||||||
'sum' => (float) $big_data_resume->verified_sum,
|
'sum' => (float) $big_data_resume->verified_sum,
|
||||||
'count' => $big_data_resume->verified_count,
|
'count' => $big_data_resume->verified_count,
|
||||||
'percentage' => $verified_percentage
|
'percentage' => $verified_count_percentage
|
||||||
],
|
],
|
||||||
'non_verified_document' => [
|
'non_verified_document' => [
|
||||||
'sum' => (float) $big_data_resume->non_verified_sum,
|
'sum' => (float) $big_data_resume->non_verified_sum,
|
||||||
'count' => $big_data_resume->non_verified_count,
|
'count' => $big_data_resume->non_verified_count,
|
||||||
'percentage' => $non_verified_percentage
|
'percentage' => $non_verified_count_percentage
|
||||||
],
|
],
|
||||||
'business_document' => [
|
'business_document' => [
|
||||||
'sum' => (float) $big_data_resume->business_sum,
|
'sum' => (float) $big_data_resume->business_sum,
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ class MenuResource extends JsonResource
|
|||||||
'url' => $this->url,
|
'url' => $this->url,
|
||||||
'sort_order' => $this->sort_order,
|
'sort_order' => $this->sort_order,
|
||||||
'parent' => $this->parent ? new MenuResource($this->parent) : null,
|
'parent' => $this->parent ? new MenuResource($this->parent) : null,
|
||||||
|
'children' => $this->when($this->relationLoaded('children'), function () {
|
||||||
|
return $this->children->sortBy('sort_order')->map(function ($child) {
|
||||||
|
return new MenuResource($child);
|
||||||
|
});
|
||||||
|
}),
|
||||||
'created_at' => $this->created_at,
|
'created_at' => $this->created_at,
|
||||||
'updated_at' => $this->updated_at
|
'updated_at' => $this->updated_at
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -64,7 +64,8 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
$query->whereHas('roles', function ($subQuery) use ($user) {
|
$query->whereHas('roles', function ($subQuery) use ($user) {
|
||||||
$subQuery->whereIn('roles.id', $user->roles->pluck('id'))
|
$subQuery->whereIn('roles.id', $user->roles->pluck('id'))
|
||||||
->where('role_menu.allow_show', 1);
|
->where('role_menu.allow_show', 1);
|
||||||
});
|
})
|
||||||
|
->orderBy('sort_order', 'asc');
|
||||||
}])
|
}])
|
||||||
->whereNull('parent_id') // Ambil hanya menu utama
|
->whereNull('parent_id') // Ambil hanya menu utama
|
||||||
->orderBy('sort_order', 'asc')
|
->orderBy('sort_order', 'asc')
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class UsersRoleMenuSeeder extends Seeder
|
|||||||
// Fetch all menus in a single query and index by name
|
// Fetch all menus in a single query and index by name
|
||||||
$menus = Menu::whereIn('name', [
|
$menus = Menu::whereIn('name', [
|
||||||
'Dashboard', 'Master', 'Settings', 'Data Settings', 'Data', 'Laporan', 'Neng Bedas',
|
'Dashboard', 'Master', 'Settings', 'Data Settings', 'Data', 'Laporan', 'Neng Bedas',
|
||||||
'Approval', 'Tools', 'Dashboard PBG', 'Users', 'Syncronize',
|
'Approval', 'Tools', 'Users', 'Syncronize', 'Dashboard Pimpinan (SIMBG)',
|
||||||
'Menu', 'Role', 'Setting Dashboard', 'PBG', 'Reklame', 'Usaha atau Industri', 'Pariwisata',
|
'Menu', 'Role', 'Setting Dashboard', 'PBG', 'Reklame', 'Usaha atau Industri', 'Pariwisata',
|
||||||
'Lap Pariwisata', 'UMKM', 'Dashboard Potensi', 'Tata Ruang', 'PDAM', 'PETA',
|
'Lap Pariwisata', 'UMKM', 'Dashboard Potensi', 'Tata Ruang', 'PDAM', 'PETA',
|
||||||
'Lap Pimpinan', 'Dalam Sistem', 'Luar Sistem', 'Google Sheets', 'TPA TPT', 'Pajak',
|
'Lap Pimpinan', 'Dalam Sistem', 'Luar Sistem', 'Google Sheets', 'TPA TPT', 'Pajak',
|
||||||
@@ -32,14 +32,14 @@ class UsersRoleMenuSeeder extends Seeder
|
|||||||
$permissions = [
|
$permissions = [
|
||||||
'superadmin' => [
|
'superadmin' => [
|
||||||
'Dashboard', 'Master', 'Settings', 'Data Settings', 'Data', 'Laporan', 'Neng Bedas',
|
'Dashboard', 'Master', 'Settings', 'Data Settings', 'Data', 'Laporan', 'Neng Bedas',
|
||||||
'Approval', 'Tools', 'Dashboard PBG', 'Users', 'Syncronize',
|
'Approval', 'Tools', 'Users', 'Syncronize', 'Dashboard Pimpinan (SIMBG)',
|
||||||
'Menu', 'Role', 'Setting Dashboard', 'PBG', 'Reklame', 'Usaha atau Industri', 'Pariwisata',
|
'Menu', 'Role', 'Setting Dashboard', 'PBG', 'Reklame', 'Usaha atau Industri', 'Pariwisata',
|
||||||
'Lap Pariwisata', 'UMKM', 'Dashboard Potensi', 'Tata Ruang', 'PDAM', 'Dalam Sistem',
|
'Lap Pariwisata', 'UMKM', 'Dashboard Potensi', 'Tata Ruang', 'PDAM', 'Dalam Sistem',
|
||||||
'Luar Sistem', 'Lap Pimpinan', 'Google Sheets', 'TPA TPT', 'Approval Pejabat',
|
'Luar Sistem', 'Lap Pimpinan', 'Google Sheets', 'TPA TPT', 'Approval Pejabat',
|
||||||
'Undangan', 'Rekap Pembayaran', 'Lap Rekap Data Pembayaran', 'Lap PBG (PTSP)', 'Lap Pertumbuhan', 'Pajak'
|
'Undangan', 'Rekap Pembayaran', 'Lap Rekap Data Pembayaran', 'Lap PBG (PTSP)', 'Lap Pertumbuhan', 'Pajak'
|
||||||
],
|
],
|
||||||
'user' => ['Dashboard', 'Data', 'Laporan', 'Neng Bedas',
|
'user' => ['Dashboard', 'Data', 'Laporan', 'Neng Bedas',
|
||||||
'Approval', 'Tools', 'Dashboard PBG', 'Users', 'Syncronize',
|
'Approval', 'Tools', 'Users', 'Syncronize', 'Dashboard Pimpinan (SIMBG)',
|
||||||
'Menu', 'Role', 'Setting Dashboard', 'PBG', 'Reklame', 'Usaha atau Industri', 'Pariwisata',
|
'Menu', 'Role', 'Setting Dashboard', 'PBG', 'Reklame', 'Usaha atau Industri', 'Pariwisata',
|
||||||
'Lap Pariwisata', 'UMKM', 'Dashboard Potensi', 'Tata Ruang', 'PDAM', 'Dalam Sistem',
|
'Lap Pariwisata', 'UMKM', 'Dashboard Potensi', 'Tata Ruang', 'PDAM', 'Dalam Sistem',
|
||||||
'Luar Sistem', 'Lap Pimpinan', 'Google Sheets', 'TPA TPT', 'Approval Pejabat',
|
'Luar Sistem', 'Lap Pimpinan', 'Google Sheets', 'TPA TPT', 'Approval Pejabat',
|
||||||
|
|||||||
Reference in New Issue
Block a user