diff --git a/app/Http/Controllers/Api/RequestAssignmentController.php b/app/Http/Controllers/Api/RequestAssignmentController.php index 4cb78e8..4d83527 100644 --- a/app/Http/Controllers/Api/RequestAssignmentController.php +++ b/app/Http/Controllers/Api/RequestAssignmentController.php @@ -36,14 +36,13 @@ class RequestAssignmentController extends Controller case 'non-business': $query->where(function ($q) { $q->where(function ($q2) { - $q2->whereRaw("LOWER(TRIM(function_type)) NOT LIKE ?", ['%fungsi usaha%']) - ->whereRaw("LOWER(TRIM(function_type)) NOT LIKE ?", ['%sebagai tempat usaha%']) - ->whereIn("status", PbgTaskStatus::getNonVerified()); + $q2->where(function ($q3) { + $q3->whereRaw("LOWER(TRIM(function_type)) NOT LIKE ?", ['%fungsi usaha%']) + ->whereRaw("LOWER(TRIM(function_type)) NOT LIKE ?", ['%sebagai tempat usaha%']); + }) + ->orWhereNull('function_type'); }) - ->orWhere(function ($q3) { - $q3->whereNull('function_type') - ->whereIn("status", PbgTaskStatus::getNonVerified()); - }); + ->whereIn("status", PbgTaskStatus::getNonVerified()); }); break; @@ -51,9 +50,9 @@ class RequestAssignmentController extends Controller $query->where(function ($q) { $q->where(function ($q2) { $q2->whereRaw("LOWER(TRIM(function_type)) LIKE ?", ['%fungsi usaha%']) - ->orWhereRaw("LOWER(TRIM(function_type)) LIKE ?", ['%sebagai tempat usaha%']) - ->whereIn("status", PbgTaskStatus::getNonVerified()); - }); + ->orWhereRaw("LOWER(TRIM(function_type)) LIKE ?", ['%sebagai tempat usaha%']); + }) + ->whereIn("status", PbgTaskStatus::getNonVerified()); }); break;