feat: automatically select all user outlets for dashboard overview if only one outlet is available.
This commit is contained in:
parent
15c36b46db
commit
a50bd0c960
@ -51,6 +51,10 @@ public function render(): View
|
||||
{
|
||||
$outletIds = $this->selectedOutletIds;
|
||||
|
||||
if (count($this->outlets) === 1) {
|
||||
$outletIds = auth()->user()->outlets()->pluck('outlets.id')->toArray();
|
||||
}
|
||||
|
||||
$todayOrder = Order::when(! empty($outletIds), fn ($q) => $q->whereIn('outlet_id', $outletIds))
|
||||
->today()
|
||||
->count();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user