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:
@@ -24,11 +24,10 @@ class HomeController extends Controller
|
|||||||
$autoOrders = DB::table('auto_orders')->count();
|
$autoOrders = DB::table('auto_orders')->count();
|
||||||
$estateOrders = DB::table('estate_orders')->count();
|
$estateOrders = DB::table('estate_orders')->count();
|
||||||
|
|
||||||
$recentOrders = collect(
|
$recentOrders = DB::table('auto_orders')
|
||||||
DB::table('auto_orders')->selectRaw('*, ordered_customer as customer')->latest()->limit(5)->get()->map(fn($o) => (object)array_merge((array)$o, ['type' => 'auto_']))
|
->selectRaw('*, ordered_customer as customer')
|
||||||
)->merge(
|
->latest()->limit(10)->get()
|
||||||
DB::table('estate_orders')->selectRaw('*, ordered_customer as customer')->latest()->limit(5)->get()->map(fn($o) => (object)array_merge((array)$o, ['type' => 'estate_']))
|
->map(fn($o) => (object)array_merge((array)$o, ['type' => 'auto_']));
|
||||||
)->sortByDesc('created_at')->take(10)->values();
|
|
||||||
|
|
||||||
$forModerate = collect(
|
$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_']))
|
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_']))
|
||||||
|
|||||||
Reference in New Issue
Block a user