update marketing
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 5m14s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 17s
Build, Push and Deploy / deploy-staging (push) Successful in 41s
Build, Push and Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-05-14 11:55:22 +07:00
parent f80fcc4c1b
commit 05fd3230b8
448 changed files with 17545 additions and 5128 deletions

View File

@@ -14,10 +14,23 @@ public function view(): View
->where('business_id', auth()->user()->business_id)
->where('type', '!=', 'Supplier')
->whereHas('sales')
->when(request('search'), function ($q) {
$q->where(function ($q) {
$q->where('name', 'like', '%' . request('search') . '%')
->orWhere('phone', 'like', '%' . request('search') . '%')
->orWhere('email', 'like', '%' . request('search') . '%')
->orWhere('type', 'like', '%' . request('search') . '%');
});
})
->withCount('sales')
->withSum('sales', 'totalAmount')
->orderByDesc('sales_count')
->orderByDesc('sales_sum_total_amount')
->when(request('type'), function ($q) {
$q->where(function ($q) {
$q->where('type', request('type'));
});
})
->take(5)
->get();