fix data and dashboard count and sum

This commit is contained in:
arifal hidayat
2025-08-08 03:17:04 +07:00
parent 588e3ad5e2
commit 1288ab509d
19 changed files with 182 additions and 78 deletions

View File

@@ -24,7 +24,8 @@ class RequestAssignmentController extends Controller
$query = PbgTask::with([
'attachments' => function ($q) {
$q->whereIn('pbg_type', ['berita_acara', 'bukti_bayar']);
}
},
'pbg_task_retributions'
])->orderBy('id', 'desc');
if ($request->has('filter') && !empty($request->get('filter'))) {
@@ -34,7 +35,8 @@ class RequestAssignmentController extends Controller
case 'non-business':
$query->where(function ($q) {
$q->where(function ($q2) {
$q2->whereRaw("LOWER(function_type) != ?", ['sebagai tempat usaha'])
$q2->whereRaw("LOWER(function_type) NOT LIKE ?", ['%fungsi usaha%'])
->whereRaw("LOWER(function_type) NOT LIKE ?", ['%sebagai tempat usaha%'])
->whereRaw("status != ?", 20)
->orWhereNull('function_type');
});
@@ -43,8 +45,11 @@ class RequestAssignmentController extends Controller
case 'business':
$query->where(function ($q) {
$q->whereRaw("LOWER(function_type) = ?", ['sebagai tempat usaha'])
->whereRaw("status != ?", 20);
$q->where(function ($q2) {
$q2->whereRaw("LOWER(function_type) LIKE ?", ['%fungsi usaha%'])
->orWhereRaw("LOWER(function_type) LIKE ?", ['%sebagai tempat usaha%'])
->whereRaw("status != ?", 20);
});
});
break;