fix update dashboard external

This commit is contained in:
arifal
2025-08-20 00:23:30 +07:00
parent 4b28bebcc2
commit 0a9d9071e4
9 changed files with 383 additions and 180 deletions

View File

@@ -126,10 +126,10 @@ class RequestAssignmentController extends Controller
->whereIn("status", PbgTaskStatus::getNonVerified())
// Additional condition: unit IS NULL OR unit <= 1
->where(function ($q3) {
$q3->whereDoesntHave('pbg_task_detail', function ($q4) {
$q3->whereDoesntHave('pbg_task_details', function ($q4) {
$q4->where('unit', '>', 1);
})
->orWhereDoesntHave('pbg_task_detail');
->orWhereDoesntHave('pbg_task_details');
});
});
break;
@@ -152,7 +152,7 @@ class RequestAssignmentController extends Controller
})
->orWhereNull('function_type');
})
->whereHas('pbg_task_detail', function ($q4) {
->whereHas('pbg_task_details', function ($q4) {
$q4->where('unit', '>', 1);
});
});
@@ -204,10 +204,10 @@ class RequestAssignmentController extends Controller
->whereIn("status", PbgTaskStatus::getNonVerified())
// Additional condition: unit IS NULL OR unit <= 1
->where(function ($q3) {
$q3->whereDoesntHave('pbg_task_detail', function ($q4) {
$q3->whereDoesntHave('pbg_task_details', function ($q4) {
$q4->where('unit', '>', 1);
})
->orWhereDoesntHave('pbg_task_detail');
->orWhereDoesntHave('pbg_task_details');
});
})
->whereExists(function ($query) {
@@ -232,10 +232,10 @@ class RequestAssignmentController extends Controller
->whereIn("status", PbgTaskStatus::getNonVerified())
// Additional condition: unit IS NULL OR unit <= 1
->where(function ($q3) {
$q3->whereDoesntHave('pbg_task_detail', function ($q4) {
$q3->whereDoesntHave('pbg_task_details', function ($q4) {
$q4->where('unit', '>', 1);
})
->orWhereDoesntHave('pbg_task_detail');
->orWhereDoesntHave('pbg_task_details');
});
})
->whereExists(function ($query) {
@@ -265,7 +265,7 @@ class RequestAssignmentController extends Controller
})
->orWhereNull('function_type');
})
->whereHas('pbg_task_detail', function ($q4) {
->whereHas('pbg_task_details', function ($q4) {
$q4->where('unit', '>', 1);
});
});
@@ -299,7 +299,7 @@ class RequestAssignmentController extends Controller
})
->orWhereNull('function_type');
})
->whereHas('pbg_task_detail', function ($q4) {
->whereHas('pbg_task_details', function ($q4) {
$q4->where('unit', '>', 1);
});
});
@@ -333,7 +333,7 @@ class RequestAssignmentController extends Controller
})
->orWhereNull('function_type');
})
->whereHas('pbg_task_detail', function ($q4) {
->whereHas('pbg_task_details', function ($q4) {
$q4->where('unit', '>', 1);
});
});
@@ -370,7 +370,7 @@ class RequestAssignmentController extends Controller
});
// If search term exists, also find UUIDs from name_building search
$namesBuildingUuids = DB::table('pbg_task_detail')
$namesBuildingUuids = DB::table('pbg_task_details')
->where('name_building', 'LIKE', "%$search%")
->pluck('pbg_task_uid')
->toArray();
@@ -528,7 +528,7 @@ class RequestAssignmentController extends Controller
})
->orWhereNull('function_type');
})
->whereHas('pbg_task_detail', function ($q4) {
->whereHas('pbg_task_details', function ($q4) {
$q4->where('unit', '>', 1);
});
});
@@ -552,10 +552,10 @@ class RequestAssignmentController extends Controller
->whereIn("status", PbgTaskStatus::getNonVerified())
// Additional condition: unit IS NULL OR unit <= 1
->where(function ($q3) {
$q3->whereDoesntHave('pbg_task_detail', function ($q4) {
$q3->whereDoesntHave('pbg_task_details', function ($q4) {
$q4->where('unit', '>', 1);
})
->orWhereDoesntHave('pbg_task_detail');
->orWhereDoesntHave('pbg_task_details');
});
})
->where('is_valid', true)