Fix car_mark error: recent-orders component is auto-only

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-06 05:52:42 +05:00
parent 446736202c
commit e84299153f

View File

@@ -24,11 +24,10 @@ class HomeController extends Controller
$autoOrders = DB::table('auto_orders')->count();
$estateOrders = DB::table('estate_orders')->count();
$recentOrders = collect(
DB::table('auto_orders')->selectRaw('*, ordered_customer as customer')->latest()->limit(5)->get()->map(fn($o) => (object)array_merge((array)$o, ['type' => 'auto_']))
)->merge(
DB::table('estate_orders')->selectRaw('*, ordered_customer as customer')->latest()->limit(5)->get()->map(fn($o) => (object)array_merge((array)$o, ['type' => 'estate_']))
)->sortByDesc('created_at')->take(10)->values();
$recentOrders = DB::table('auto_orders')
->selectRaw('*, ordered_customer as customer')
->latest()->limit(10)->get()
->map(fn($o) => (object)array_merge((array)$o, ['type' => 'auto_']));
$forModerate = collect(
DB::table('auto_orders')->selectRaw('*, ordered_customer as customer')->where('status', 'moderated')->latest()->limit(10)->get()->map(fn($o) => (object)array_merge((array)$o, ['type' => 'auto_']))