Kaynağa Gözat

fix(financial-dashboard): update franchise name field to use 'name' instead of 'fantasy_name'

alvesantos 5 gün önce
ebeveyn
işleme
d7103c3e02
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      app/Services/FinancialDashboardService.php

+ 2 - 2
app/Services/FinancialDashboardService.php

@@ -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,