fix total all, business and non business total and percentage

This commit is contained in:
arifal
2025-02-04 12:10:13 +07:00
parent 6e726b4940
commit 9e506ebbaa
5 changed files with 209 additions and 1057 deletions

View File

@@ -19,8 +19,7 @@ class DashboardController extends Controller
DB::raw('SUM(pbg_task_retributions.nilai_retribusi_bangunan) as total_retribution')
)
->where(function ($query) {
$query->where("pbg_task.function_type", "NOT LIKE", "sebagai tempat usaha%")
->orWhereNull("pbg_task.function_type");
$query->where("pbg_task.function_type", "LIKE", "sebagai tempat usaha%");
})
->first();
$taskCount = $businessData->task_count;
@@ -40,7 +39,8 @@ class DashboardController extends Controller
DB::raw('SUM(pbg_task_retributions.nilai_retribusi_bangunan) as total_retribution')
)
->where(function ($query) {
$query->where("pbg_task.function_type", "LIKE", "sebagai tempat usaha%");
$query->where("pbg_task.function_type", "NOT LIKE", "sebagai tempat usaha%")
->orWhereNull("pbg_task.function_type");
})
->first();
$taskCount = $businessData->task_count;