From 59de0216ac8c4cb8610b40eab56916ccb8326c70 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 6 Dec 2022 17:45:28 +1100 Subject: [PATCH] improve query efficiency --- app/Http/Controllers/InvoiceController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index d21ae1c13f..53fec504fa 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -219,6 +219,9 @@ class InvoiceController extends BaseController $clients = $clients->where('clients.user_id', '=', Auth::user()->id); } + if($clientPublicId != 0) + $clients->where('public_id', $clientPublicId); + $data = [ 'clients' => $clients->get(), 'entityType' => $invoice->getEntityType(),