partial update fix redirect and add note in public, quick and pbg data

This commit is contained in:
arifal
2025-09-10 17:24:44 +07:00
parent 5c4cebd2b3
commit beb7d935c9
155 changed files with 161 additions and 91 deletions

View File

@@ -25,15 +25,16 @@ class BigDataResumeController extends Controller
{
try{
$filterDate = $request->get("filterByDate");
$type = $request->get("type");
$type = trim($request->get("type"));
if (!$filterDate || $filterDate === "latest") {
$big_data_resume = BigdataResume::findOrFail(168);
$big_data_resume = BigdataResume::where('resume_type', $type)->latest()->first();
if (!$big_data_resume) {
return $this->response_empty_resume();
}
} else {
$big_data_resume = BigdataResume::whereDate('created_at', $filterDate)
->where('resume_type', $type)
->orderBy('id', 'desc')
->first();

View File

@@ -57,7 +57,8 @@ class RequestAssignmentController extends Controller
$q->whereIn('pbg_type', ['berita_acara', 'bukti_bayar']);
},
'pbg_task_retributions',
'pbg_task_detail'
'pbg_task_detail',
'pbg_status'
])->orderBy('id', 'desc');
// Log final query count for debugging
@@ -127,10 +128,10 @@ class RequestAssignmentController extends Controller
->whereIn("status", PbgTaskStatus::getNonVerified())
// Additional condition: unit IS NULL OR unit <= 1
->where(function ($q3) {
$q3->whereDoesntHave('pbg_task_details', function ($q4) {
$q3->whereDoesntHave('pbg_task_detail', function ($q4) {
$q4->where('unit', '>', 1);
})
->orWhereDoesntHave('pbg_task_details');
->orWhereDoesntHave('pbg_task_detail');
});
});
break;
@@ -153,7 +154,7 @@ class RequestAssignmentController extends Controller
})
->orWhereNull('function_type');
})
->whereHas('pbg_task_details', function ($q4) {
->whereHas('pbg_task_detail', function ($q4) {
$q4->where('unit', '>', 1);
});
});
@@ -205,10 +206,10 @@ class RequestAssignmentController extends Controller
->whereIn("status", PbgTaskStatus::getNonVerified())
// Additional condition: unit IS NULL OR unit <= 1
->where(function ($q3) {
$q3->whereDoesntHave('pbg_task_details', function ($q4) {
$q3->whereDoesntHave('pbg_task_detail', function ($q4) {
$q4->where('unit', '>', 1);
})
->orWhereDoesntHave('pbg_task_details');
->orWhereDoesntHave('pbg_task_detail');
});
})
->whereExists(function ($query) {
@@ -233,10 +234,10 @@ class RequestAssignmentController extends Controller
->whereIn("status", PbgTaskStatus::getNonVerified())
// Additional condition: unit IS NULL OR unit <= 1
->where(function ($q3) {
$q3->whereDoesntHave('pbg_task_details', function ($q4) {
$q3->whereDoesntHave('pbg_task_detail', function ($q4) {
$q4->where('unit', '>', 1);
})
->orWhereDoesntHave('pbg_task_details');
->orWhereDoesntHave('pbg_task_detail');
});
})
->whereExists(function ($query) {
@@ -266,7 +267,7 @@ class RequestAssignmentController extends Controller
})
->orWhereNull('function_type');
})
->whereHas('pbg_task_details', function ($q4) {
->whereHas('pbg_task_detail', function ($q4) {
$q4->where('unit', '>', 1);
});
});
@@ -300,7 +301,7 @@ class RequestAssignmentController extends Controller
})
->orWhereNull('function_type');
})
->whereHas('pbg_task_details', function ($q4) {
->whereHas('pbg_task_detail', function ($q4) {
$q4->where('unit', '>', 1);
});
});

View File

@@ -54,7 +54,10 @@ class AuthenticatedSessionController extends Controller
session(['login_timestamp' => now()->timestamp]);
session(['user_id' => $user->id]);
return redirect()->intended(RouteServiceProvider::HOME);
// Append menu_id dynamically to HOME
$menuId = optional(\App\Models\Menu::where('name', 'Dashboard Pimpinan SIMBG')->first())->id;
$home = RouteServiceProvider::HOME . ($menuId ? ('?menu_id=' . $menuId) : '');
return redirect()->intended($home);
}
/**

View File

@@ -34,7 +34,8 @@ class QuickSearchController extends Controller
$query = PbgTask::select([
'pbg_task.*',
DB::raw('(SELECT name_building FROM pbg_task_details WHERE pbg_task_details.pbg_task_uid = pbg_task.uuid LIMIT 1) as name_building'),
DB::raw('(SELECT nilai_retribusi_bangunan FROM pbg_task_retributions WHERE pbg_task_retributions.pbg_task_uid = pbg_task.uuid LIMIT 1) as nilai_retribusi_bangunan')
DB::raw('(SELECT nilai_retribusi_bangunan FROM pbg_task_retributions WHERE pbg_task_retributions.pbg_task_uid = pbg_task.uuid LIMIT 1) as nilai_retribusi_bangunan'),
DB::raw('(SELECT note FROM pbg_statuses WHERE pbg_statuses.pbg_task_uuid = pbg_task.uuid LIMIT 1) as note')
])
->orderBy('pbg_task.id', 'desc');
@@ -141,7 +142,8 @@ class QuickSearchController extends Controller
$data = PbgTask::with([
'pbg_task_retributions',
'pbg_task_index_integrations',
'pbg_task_retributions.pbg_task_prasarana'
'pbg_task_retributions.pbg_task_prasarana',
'pbg_status'
])->findOrFail($id);
$statusOptions = PbgTaskStatus::getStatuses();

View File

@@ -32,7 +32,7 @@ class PbgTaskController extends Controller
'destroyer' => $destroyer,
'filter' => $filter,
'filterOptions' => PbgTaskFilterData::getAllOptions(),
]);
]);
}
/**
@@ -61,6 +61,7 @@ class PbgTaskController extends Controller
'pbg_task_index_integrations',
'pbg_task_retributions.pbg_task_prasarana',
'pbg_task_detail',
'pbg_status',
'dataLists' => function($query) {
$query->orderBy('data_type')->orderBy('name');
}
@@ -69,20 +70,6 @@ class PbgTaskController extends Controller
// Group data lists by data_type for easier display
$dataListsByType = $data->dataLists->groupBy('data_type');
// Debug: Log the data types found for this task
\Log::info('PBG Task Data Lists', [
'task_uuid' => $data->uuid,
'total_data_lists' => $data->dataLists->count(),
'data_types_found' => $dataListsByType->keys()->toArray(),
'data_types_with_names' => $dataListsByType->map(function($items, $type) {
return [
'type' => $type,
'name' => $items->first()->data_type_name ?? "Type {$type}",
'count' => $items->count()
];
})->values()->toArray()
]);
$statusOptions = PbgTaskStatus::getStatuses();
$applicationTypes = PbgTaskApplicationTypes::labels();

View File

@@ -44,6 +44,7 @@ class RequestAssignmentResouce extends JsonResource
->first(),
'pbg_task_retributions' => $this->pbg_task_retributions,
'pbg_task_detail' => $this->pbg_task_detail,
'pbg_status' => $this->pbg_status,
];
}
}

View File

@@ -7,6 +7,7 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvi
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
use App\Models\Menu;
class RouteServiceProvider extends ServiceProvider
{
@@ -17,7 +18,7 @@ class RouteServiceProvider extends ServiceProvider
*
* @var string
*/
public const HOME = '/home';
public const HOME = '/dashboards/bigdata';
/**
* Define your route model bindings, pattern filters, and other route configuration.