fix data and dashboard count and sum
This commit is contained in:
@@ -23,14 +23,15 @@ class BigDataResumeController extends Controller
|
||||
{
|
||||
try{
|
||||
$filterDate = $request->get("filterByDate");
|
||||
$type = $request->get("type");
|
||||
|
||||
if (!$filterDate || $filterDate === "latest") {
|
||||
$big_data_resume = BigdataResume::where('year', 'leader')->latest()->first();
|
||||
$big_data_resume = BigdataResume::where('year', $type)->latest()->first();
|
||||
if (!$big_data_resume) {
|
||||
return $this->response_empty_resume();
|
||||
}
|
||||
} else {
|
||||
$big_data_resume = BigdataResume::where('year', 'leader')
|
||||
$big_data_resume = BigdataResume::where('year', $type)
|
||||
->whereDate('created_at', $filterDate)
|
||||
->orderBy('id', 'desc')
|
||||
->first();
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user