This commit is contained in:
Gowtham M 2025-09-26 17:02:37 +05:30
parent 76ef70093e
commit d863f8ca7b

View File

@ -1045,13 +1045,17 @@ class PlanController extends ResourceController
return $plan['created_on'] >= $todayStart && $plan['created_on'] <= $todayEnd;
});
$todayTypeCounts = array_count_values(array_column($todayType, 'trip_type'));
// $todayTypeCounts = array_count_values(array_column($todayType, 'trip_type'));
$todayType = array_map('intval', array_filter(array_column($todayType, 'trip_type')));
$todayTypeCounts = array_count_values($todayType);
$weeklyType = array_filter($plans, function ($plan) use ($startOfWeek, $endOfWeek) {
return $plan['created_on'] >= $startOfWeek && $plan['created_on'] <= $endOfWeek;
});
$weeklyTypeCounts = array_count_values(array_column($weeklyType, 'trip_type'));
// $weeklyTypeCounts = array_count_values(array_column($weeklyType, 'trip_type'));
$weeklyType = array_map('intval', array_filter(array_column($weeklyType, 'trip_type')));
$weeklyTypeCounts = array_count_values($weeklyType);
for ($i = 1; $i <= 2; $i++) { // Fixed loop condition
$typeResult[] = [