|
|
@@ -175,14 +175,14 @@ private function franchisePerformance(Carbon $start, Carbon $end): array
|
|
|
|
|
|
return DB::table('units')
|
|
|
->whereNull('deleted_at')
|
|
|
- ->get(['id', 'fantasy_name'])
|
|
|
+ ->get(['id', 'name'])
|
|
|
->map(function ($unit) use ($revenue, $expense) {
|
|
|
$rev = (float) ($revenue[$unit->id] ?? 0);
|
|
|
$exp = (float) ($expense[$unit->id] ?? 0);
|
|
|
|
|
|
return [
|
|
|
'id' => $unit->id,
|
|
|
- 'franchise' => $unit->fantasy_name,
|
|
|
+ 'franchise' => $unit->name,
|
|
|
'revenue' => $rev,
|
|
|
'expense' => $exp,
|
|
|
'performance' => $rev > 0 ? round((($rev - $exp) / $rev) * 100, 1) : 0,
|